I upgraded to React Native 0.44, and reinstalled this library following the manual method in the docs (the automatic method was giving me problems), and now the app builds and runs from Xcode, but I get this error when importing it:
Follow the manual ios setup docs on this repos documentation - you're missing rnfirebase being included
Was having the same problem when integrating in iOS and as @Salakar already mentioned, I missed including it into my project. :stuck_out_tongue_winking_eye:
I followed the manual documentation and I'm not sure what I'm missing. Adding it to the app by right-clicking the Libraries folder in xcode and selecting 'Add Files to "App"...' is how you include it, right? Cause I did that and added the RNFirebase.xcodeproj. Then I checked to make sure it had all of the correct header search paths
I even tried linking libRNFirebase.a in the Link Binary with Libraries section of Build Phases, and nothing changed.
All of the Firebase pods are also installed and the AppDelegate.m has all of the required code
You need to add it to your podfile, like this oe: https://github.com/invertase/react-native-firebase-tests/blob/master/ios/Podfile#L39
Added the line to the podfile and ran pod install, now I'm getting these errors 😩
^^^ same here
Am looking into this now
Can confirm this definitely works, are you guys doing anything different than what the install docs suggest?
cc @chrisbianca
@Salakar my steps look like this...
@Salakar I just tried unlinking, removing the podfile, npm uninstalling, cleaning the Xcode project, and going through the installation again, and unfortunately I'm getting the same error.
After exploring the project more, I noticed that the RNFirebase.Framework's Headers folder was empty. Could this be the issue?
UPDATE: I tried adding the header files in the RNFirebase folder to the RNFirebase.Framework Headers folder, and it didn't make a difference.
I'm also experiencing this issue, haven't found a work around yet. Any updates appreicated!
Tried removing the FirebaseAnalytics
import and found FirebaseCore
not found too.
@grylance @jackread @arminsal1 out of interest what's your xcode versions?
@Salakar I'm running version 8.3.2 (8E2002)
Hmm i just upgraded to 8.3.2 just now and tried again and it was fine, weird this.
Either of you got screen sharing software? I can take a look then and debug it.
Can you also both show me your podfiles. @grylance @arminsal1
I have 'RCTEventDispatcher.h not found in RNFirebase.h' issue.
Then add all like this https://github.com/invertase/react-native-firebase-tests/blob/master/ios/Podfile#L39 to podfile, it crash with Thread 1 Program Received Signal SIGABRT .
@Salakar I don't have screen sharing software, but I can download any one you want to use and we can debug tomorrow morning.
Also here's my podfile:
Running XCode 8.2.1
Podfile:
use_frameworks!
pod 'Fabric'
pod 'Crashlytics'
pod 'Bolts'
pod 'FBSDKCoreKit', '4.20.2'
pod 'FBSDKShareKit', '4.20.2'
target 'xxx' do
platform :ios, '9.0'
pod 'FBSDKLoginKit', '4.20.2'
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Analytics'
pod 'Firebase/AppIndexing'
pod 'Firebase/Core'
pod 'Firebase/Crash'
pod 'Firebase/Database'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Messaging'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Storage'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
pod 'Instabug', '~> 7.0'
pod 'Realm', '2.6.1'
end
target 'xxx-tvOS' do
platform :tvos, '9.0'
pod 'FBSDKTVOSKit', '4.20.2'
end
I FIGURED IT OUT!
All you need to do is comment out "use_frameworks!"
I had to uncomment it for a different library, so if it's possible to make RNFirebase compatible with "use_frameworks!" enabled that would be cool. But I don't know how realistic or necessary of a request that is
Not working for me. I didnt have that line anyway.
If you have something like:
then try replace all those lines with:
react_native_path = "../node_modules/react-native"
pod "Yoga", :path => "#{react_native_path}/ReactCommon/yoga"
# Pods for ReactNativeFirebaseDemo
pod 'React', :path => '../node_modules/react-native'
I did have some weird issues with subspecs on RN 44, not sure if related. Also try what @arminsal1 suggested, remove the use_frameworks line.
Am also free today to screenshare and debug if someone with this issue can contact me via DM on gitter or discord please. Discord preferably 🙈
Also, can you try the latest version: v1.0.5 - might be duplicated RN dependencies causing an issue maybe.
I've encountered the problems related here when installing react-native-firebase.
I use
I've installed react-native-firebase manually by following the part 2: http://invertase.io/react-native-firebase/#/installation-ios?id=_23-you39re-not-using-cocoapods-or-don39t-have-react-native-installed-as-a-pod-manual-install. My Podfile contains only the Firebase dependencies:
target 'MyApp' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for MyApp
pod 'Firebase/Auth'
pod 'Firebase/Analytics'
pod 'Firebase/AppIndexing'
pod 'Firebase/Core'
pod 'Firebase/Crash'
pod 'Firebase/Database'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Messaging'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Storage'
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
end
With this configuration, the build is ok, but I get the RedBox "Native Module cannot be null" when importing import RNFirebase from 'react-native-firebase';
.
I've added this line to the Podfile:
pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
With this configuration, I get the error: 'RCTEventDispatcher.h' file not found
Note that I get the same error if I remove the __has_include
tricks:
#import <React/RCTEventDispatcher.h>
#import <React/RCTEventEmitter.h>
#import <React/RCTBridgeModule.h>
I've tried to add RN in my Podfile to get rid of the header error:
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'React', :path => '../node_modules/react-native'
Everything works fine now 💃 🕺
Hope it helps.
Still getting
Native module cannot be null
for react-native 0.44 and react-native-firebase 1.0.10. Tried Link automatic method and manual method. same error.
@arminsal1 DId you solve the issue by commenting out the use_frameworks line in podfile. I ask because mine podfile already has that line commented out and still getting the posted error.
@metalmalte did you ever solve it?
Been Trying to integrate this lib with my existing project for couple weeks. Still no luck :(
@jasan-s Sorry to hear that, man. My issue got resolved after commenting out the use_frameworks
line. You probably already tried this, but if I were you I would completely unlink and remove all things related to RNFirebase from your Xcode project and npm uninstall --save
it. And then go through the manual installation process without "use_frameworks". If that doesn't work, try the automatic linking. Unfortunately, that's all I can think of
@jasan-s Have you tried @ncuillery 's method?
@jasan-s try update your podfile to something like the below for RN 44, it works here on 44
install! 'cocoapods', :deterministic_uuids => false
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'ReactNativeFirebaseDemo' do
platform :ios, '8.0'
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
react_native_path = "../node_modules/react-native"
pod "Yoga", :path => "#{react_native_path}/ReactCommon/yoga"
# Pods for ReactNativeFirebaseDemo
pod 'React', :path => '../node_modules/react-native'
pod 'Firebase/Auth'
pod 'Firebase/Analytics'
pod 'Firebase/AppIndexing'
pod 'Firebase/Core'
pod 'Firebase/Crash'
pod 'Firebase/Database'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Messaging'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Storage'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
end
@arminsal1 I have completely uninstalled everything and tried manual process and then completely uninstalled everything and tries automatic linking method. still same error. I event tried @Salakar podfile inculding yoga, React and RNfirebase.
I also get the following error within the command line, if it helps narrow the reason for the error:
```
ld: framework not found FirebaseAnalytics
clang: error: linker command failed with exit code 1 (use -v to see invocation)
and the following warnings at pod install:
[!] The ReactModoro [Debug]
target overrides the FRAMEWORK_SEARCH_PATHS
build setting defined in Pods/Target Support Files/Pods-ReactModoro/Pods-ReactModoro.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the
$(inherited)` flag, or
- Remove the build settings from the target.
[!] The ReactModoro [Release]
target overrides the FRAMEWORK_SEARCH_PATHS
build setting defined in Pods/Target Support Files/Pods-ReactModoro/Pods-ReactModoro.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the
$(inherited)` flag, or
- Remove the build settings from the target.
[!] FirebaseAppIndexing has been deprecated
```
I was having this problem as well.
@Salakar I used the pod file you posted in https://github.com/invertase/react-native-firebase/issues/95#issuecomment-302483323
Now Xcode is saying
I've tried changing it to @import Firebase;
and I get the same thing.
UPDATE
When building in Xcode the app launches and runs it seems (I haven't tried actually using the firebase SDK yet though). When building from the command line the build finishes without any errors and the app launches.
@Salakar this podfile is working for me in RN 0.44, Thanks!~
install! 'cocoapods', :deterministic_uuids => false
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'ReactNativeFirebaseDemo' do
platform :ios, '8.0'
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
react_native_path = "../node_modules/react-native"
pod "Yoga", :path => "#{react_native_path}/ReactCommon/yoga"
# Pods for ReactNativeFirebaseDemo
pod 'React', :path => '../node_modules/react-native'
pod 'Firebase/Auth'
pod 'Firebase/Analytics'
pod 'Firebase/AppIndexing'
pod 'Firebase/Core'
pod 'Firebase/Crash'
pod 'Firebase/Database'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Messaging'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Storage'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
end
I have been putting off upgrading to 0.44
for this reason – is there consensus now on what the upgrade path is? If so, there should be some documentation about this somewhere. I'm happy to help write it up if someone can tell me what the solution is. Thanks all!
The upgrade path is as per my podfile above, you can also use the tests app in the tests folder on repo for reference, this is running on 0.44 - the v2 branch has better handling of pods in general i.e all pods for firebase are now optional. You may need to hard set the react dependency on your package.json file, again, see tests app for ref.
Will close this now as several of us have apps running on 0.44 and this has generally been covered as react upgrade issues rather than specifically relating to RNFirebase.
If any feels documentation is needed that relates to RNFirebase upgrading then feel free to PR :)
Most helpful comment
@jasan-s try update your podfile to something like the below for RN 44, it works here on 44