I checked and the line causing the error was just updated yesterday https://github.com/evollu/react-native-fcm/commit/da07b4d2d769eb112a33b696efa324cf2892ec1d
Not sure what I am missing.
react-native: 0.53.3
react-native-fcm: ^14.0.0
Replacing the @import Firebase; line with
@import FirebaseCore;
@import FirebaseMessaging;
@import FirebaseInstanceID;
Seems to work for me.
@import Firebase; is how FCM official document suggests.
Probably you are missing something in pod install.
Same problem here after update the library, I'm not using cocoapods.
I think that @import Firebase; is not supported for all use cases yet.
In README file that is shipped with Firebase Library:
- Drag the
Firebase.hheader in this directory into your project. This will
allow you to#import "Firebase.h"and start using any Firebase SDK that you
have.
The standalone library can be downloaded here: https://firebase.google.com/download/ios
let me check. it is such a headache.
@douglasjunior can you try add module.modulemap file next to the header file?
module Firebase {
export *
header "Firebase.h"
}
I also suffer with these problems in a project that I maintain douglasjunior/react-native-keyboard-manager#20 馃槃
About the module.modulemap file, is something like this?

Not worked too.
Same problem here, I'm using cocoapods.
same problem :(
same :(
@vic9511 cocoapod should not have problem. the example project is using cocoapods without issue
@evollu
I'm using cocoapods in my project. Updated to the latest version of react-native-fcm and since then I'm getting this error. Also tried to pod update and it didn't help.
Tried to clean everything and reinstall again - still getting this error. at the moment, the only possible workaround I found is to revert to v13...
@dotansimha can you compare the project with the example project? that works without issue
@evollu yes you right, sorry for that. It seems that I had a conflict with linkings.
@dotansimha we fixed that closing xcode and deletting ios/Pods and Podfile.lock
Add in your Podfile just: pod 'Firebase/Messaging'
Also delete node_modules and run yarn again and run pod install as well
And re-check again Manual linkings https://facebook.github.io/react-native/docs/linking-libraries-ios.html
Maybe you can also try react-native unlink react-native-fcm to prevent other linkings conflict (although it should not affect)
Hope this can help you!
added example of manual integration under no-pod branch. also updated readme a bit
@douglasjunior
Adding User Header Search Paths and creating module.modulemap made it work. Thanks.
@jaschaio issue seems to be solved. can i close this?
Replacing @import FirebaseCore with the below code worked for me.
#import <FirebaseCore/FirebaseCore.h>
#import <FirebaseMessaging/FirebaseMessaging.h>
#import <FirebaseInstanceID/FirebaseInstanceID.h>
(note I'm integration react-native in an existing project that uses cocoapods)
@bkvirendra this is not a solution.
I'm not going to change it back to use #import
@vic9511 I've been struggling with this same issue for a few hours after upgrading to latest version. I've tried the manual route and the Pods route. Followed your steps and deleted nod_modules, pods, reran everything. Now Im getting some new failures which seems like progress.
Undefined symbols for architecture x86_64:
"_kFIRServiceAuthUI", referenced from:
+[FIRDiagnostics populateLogProtoWithInstalledServices:] in FirebaseCoreDiagnostics(FIRDiagnostics_0c03a82afb19aa444c2f4902b5217b60.o)
+[FIRDiagnostics mapFromServiceStringToTypeEnum:] in FirebaseCoreDiagnostics(FIRDiagnostics_0c03a82afb19aa444c2f4902b5217b60.o)
"_kFIRServiceFirestore", referenced from:
+[FIRDiagnostics populateLogProtoWithInstalledServices:] in FirebaseCoreDiagnostics(FIRDiagnostics_0c03a82afb19aa444c2f4902b5217b60.o)
+[FIRDiagnostics mapFromServiceStringToTypeEnum:] in FirebaseCoreDiagnostics(FIRDiagnostics_0c03a82afb19aa444c2f4902b5217b60.o)
"_kFIRServicePerformance", referenced from:
+[FIRDiagnostics populateLogProtoWithInstalledServices:] in FirebaseCoreDiagnostics(FIRDiagnostics_0c03a82afb19aa444c2f4902b5217b60.o)
+[FIRDiagnostics mapFromServiceStringToTypeEnum:] in FirebaseCoreDiagnostics(FIRDiagnostics_0c03a82afb19aa444c2f4902b5217b60.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@evollu Any idea what I might've done wrong now?
EDIT Disregard. I'm sorry for the noise, I solved this. I had an old framework file in my iOS folder that was causing the issue. I'm back up and running. Thanks for this library and your work
Hello, @evollu It looks like the fix to the podspec file was working for 11.3 but not anymore, I'll try to fix it so we can use the new syntax
EDIT: Spent 2 hours, still no result.
Best way right now is
@import FirebaseCore;
@import FirebaseMessaging;
@import FirebaseInstanceID;
@Titozzz pod solution has been working fine for me. Can you share a public repo that has the issue?
Will do asap.
I am using cocoapods and am also facing the same issue. I tried to above solutions, I also tried reinstalling and re-doing my manual linking. But still I find the 'Module Firebase not found' error.
Also,
@import FirebaseCore;
@import FirebaseMessaging;
@import FirebaseInstanceID;
replacing the line with this just simply gives out 'Module FirebaseCore not found' instead.
@brzonsea can you try using this instead, and see if that works for you?
#import <FirebaseCore/FirebaseCore.h>
#import <FirebaseMessaging/FirebaseMessaging.h>
#import <FirebaseInstanceID/FirebaseInstanceID.h>
@bkvirendra
I tried it just now, and "'FirebaseCore/FirebaseCore.h' file not found" is the error message now.
Am I missing some critical step in the setup process? I think I've read the README quite thoroughly, but what are these FirebaseCore, FirebaseMessaging, FirebaseInstanceID stuff?
@brzonsea do you have the pod 'FirebaseMessaging' in your Podfile?
Also, can you check if you have the following in Header Search Paths,

@bkvirendra
Thanks for the detailed image! I didn't have the above Header Search Paths, so I added them.
But the problem is not solved yet... And yes, I have the pod 'FirebaseMessaging' in my Podfile
@brzonsea can you paste the detailed versions & the traceback for the exception?
@bkvirendra
My versions are
react-native: 0.51.1
react-native-fcm: ^14.1.0
cocoapods: 1.4.0
And this is the error message:
In file included from /Users/namungkim/Projects/Classum/ClassumReactNativeApp/node_modules/react-native-fcm/ios/RNFIRMessaging.m:1:
/Users/namungkim/Projects/Classum/ClassumReactNativeApp/node_modules/react-native-fcm/ios/RNFIRMessaging.h:4:9: fatal error: 'FirebaseCore/FirebaseCore.h' file not found
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Guys, I think we have 2 separate issues here, on my side i'm taking about people linking the library with cocoapods with this kind of podfile:
target 'test' do
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
'RCTText',
'RCTImage',
'RCTNetwork',
'RCTWebSocket',
'RCTSettings',
'RCTAnimation',
'RCTLinkingIOS',
# Add any other subspecs you want to use in your project
]
pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'react-native-amplitude-analytics', :path => '../node_modules/react-native-amplitude-analytics'
pod 'CodePush', :path => '../node_modules/react-native-code-push'
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
pod 'react-native-fcm', :path => '../node_modules/react-native-fcm'
pod 'react-native-google-signin', :path => '../node_modules/react-native-google-signin'
pod '....'
end
However you guys are using the podfile to only link the native dependencies manually:
target 'test' do
pod 'Firebase/Messaging'
pod '....'
end
The point of using method n掳1 is that you only link using the cli and the dependencies are specified inside the podspec file. cc @evollu
@bkvirendra
It seems I was using the firebase web sdk, so prior native settings for firebase wasn't done. After installing react-native-firebase, and following your advice it is working now! Thanks!
@brzonsea for everyone having issue with
#import <FirebaseCore/FirebaseCore.h>
You are not having the latest version of the repo. This line has been updated by following
https://github.com/evollu/react-native-fcm/blob/v14.0.1/ios/RNFIRMessaging.h#L4
@evollu Issue is not fixed for users using cocoapods like me tho... Right now I did this:
in my postinstall hooks:
"sed -i'' -e 's/@import Firebase;/@import FirebaseCore;@import FirebaseMessaging;@import FirebaseInstanceID;/' ./node_modules/react-native-fcm/ios/RNFIRMessaging.h"
@Titozzz please post an example github repo with the issue.
@Titozzz same here... my pod file has:
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'react-native-fcm', :path => '../node_modules/react-native-fcm'
Tried to clean and rebuild everything - still the same.
https://github.com/Titozzz/ReactNativeStarterCocoapods
To install:
cd ReactNativeStarterCocoapods
pod install
To build: Use Xcode or command line
@evollu there you go, if you don't run yarn fix-react-native-fcm, the build will fail.
@Titozzz will try. thanks
@Titozzz The problem is it is trying to build react-native-fcm as a pod project but it doesn't know how to load module map from peers. it is really tricky. do you have to do it this way?
Yes and i'm not alone, the thing is, with react native that once you add a podfile to your project, it will try to link that way and only that way. I could link manually, I could rename my podfile during the link, but I'd rather try to find a solution so that everyone is happy.
EDIT: Please note that Firebase and Google Pods are really badly packaged and it's only with cocoapods 1.4 that we can start to hope that they will fix it with static_framework option
@Titozzz I'm trying
#if __has_include(<FirebaseAnalytics/FirebaseAnalytics.h>)
@import Firebase;
#else
@import FirebaseCore;
@import FirebaseMessaging;
@import FirebaseInstanceID;
#endif
but it complains module FirebaseCore not found
but does it work if you only put
@import FirebaseCore;
@import FirebaseMessaging;
@import FirebaseInstanceID;
?
no either.
I'm using cocoapod 1.3. Do I have to use 1.4?
For me, running this as script in postinstall works:
#/bin/sh
sed -i'' -e 's/@import Firebase;/\
#import <FirebaseCore\/FirebaseCore.h>;\
#import <FirebaseMessaging\/FirebaseMessaging.h>;\
#import <FirebaseInstanceID\/FirebaseInstanceID.h>;/' ./node_modules/react-native-fcm/ios/RNFIRMessaging.h
That's weird, because on the example repo I gave you it works for me (you can patch with yarn fix-react-native-fcm). Can you check your cocoapods version and be sure you are ^1.4.0 ?
#if __has_include(<Firebase.h>)
#import <FirebaseCore/FirebaseCore.h>
#import <FirebaseMessaging/FirebaseMessaging.h>
#import <FirebaseInstanceID/FirebaseInstanceID.h>
#else
@import Firebase;
#endif
yep seems to be working for every cases. let me know
Sorry I did not pay attention to you when you said you were using Cocoapods 1.3 馃槩 . Cocoapods 1.4 released this new feature allowing us to use static_frameworks (http://blog.cocoapods.org/CocoaPods-1.4.0/) that I specified in the podspec file of this repo. So I guess our differences comes from here. Let me try your syntax.
EDIT:
Maybe we need to follow those:
https://github.com/firebase/quickstart-ios/issues/245
https://github.com/firebase/firebase-ios-sdk/issues/766
@Titozzz anyway my code above should work for you.
it is released in latest item
I can confirm that it works, thank you for the fix. Great work 馃帀
@import Firebase;
gives error of module firebase not found...
I have read all above comments and implemented all
but none worked for me...
I have added path of module.modulemap to header search path but it didn't help
I have not used cocoapods.
Please help asap
Thanks in advance
@jaschaio: it's work for me. Thank u.
If you're using objective-c just drag the file firebase.h into your project
I saw this error due to a missed instruction in the terminal output after installing the pod:
"Please close any current Xcode sessions and use <ProjectName>.xcworkspace for this project from now on.
Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed."
Opening the new .xcworkspace fixed it for me.
such a headache, i'm still facing this issue on Xcode 9.4, "react-native-fcm": "11.2.0". Any solutions so far 馃棥
Hi
Espa帽ol:
tenia una version antigua de firebase analytics la actualiza, luego npm install despu茅s pod install para terminar luego agregando estas lineas.
Ingles:
had an old version of firebase analytics update it, then * npm install * then pod install to finish then adding these lines.
I found the problem with pod 'RNFirebase', :path => '../node_modules/react-native-firebase'.
Solution:
I commented pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
react-native link
cd ios
pod install (install all firesbase modules)
cd ..
npm install or yarn install
Then, try adding @import Firebase
react-native run-ios
It worked for me..!!Hope this help you guys.!
@import FirebaseCore;
@import FirebaseMessaging;
@import FirebaseInstanceID;
First two no problem, but the third one shows error Module 'FirebaseInstanceID' not found.
Most helpful comment
Replacing the
@import Firebase;line withSeems to work for me.