react-native-fcm: FirebaseCore/FIRApp.h' file not found
Upgrading to version 10.0.0 (from a quite an older version), iOS build failed with the following error:
xxxxxx/node_modules/react-native-fcm/ios/RNFIRMessaging.m:1:
xxxxxx/node_modules/react-native-fcm/ios/RNFIRMessaging.h:4:9: fatal error: 'FirebaseCore/FIRApp.h' file not found
#import <FirebaseCore/FIRApp.h>
^
1 error generated.
This affects debug builds only.
I believe the that the cause is framework/header search paths in RNFIRMessaging.xcodeproj/project.pbxproj:
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/../../../ios/Pods/**",
"$(SRCROOT)/../../../node_modules/react-native-firestack/ios/**",
);
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../react-native/React/**",
"$(PROJECT_DIR)/../../../ios/Pods/**",
"$(SRCROOT)/../../../node_modules/react-native-firestack/ios/**",
while in Release scheme it is set to this:
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/../../../ios/**",
"$(SRCROOT)/../../../node_modules/react-native-firestack/ios/**",
);
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../react-native/React/**",
"$(SRCROOT)/../../../ios/**",
"$(SRCROOT)/../../../node_modules/react-native-firestack/ios/**",
);
This configuration assumes usage of Cocoapods.
Changing "$(PROJECT_DIR)/../../../ios/Pods/**" to the more universal "$(PROJECT_DIR)/../../../ios/**" as in the Release scheme fixes this issue
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 8
- Comments: 22 (7 by maintainers)
@sibelius Move all your Firebase SDK into /ios/Pods folder. it is not working for you?
At the end I just used apns for the project push notification
when I try to call
then I have a crash
who can say what it may be?
@sibelius: How did you manage to resolve the crash? What links did you add in Xcode? Getting the same crash
I resolved this by adding the following to Build Settings => Framework Search Paths in the RNFIRMessaging project:
$(PROJECT_DIR)/…/…/…/ios/Pods/FirebaseCore $(PROJECT_DIR)/…/…/…/ios/Pods/FirebaseMessaging $(PROJECT_DIR)/…/…/…/ios/Pods/FirebaseAnalytics $(PROJECT_DIR)/…/…/…/ios/Pods/FirebaseInstanceID
Note that it’s not Header Search Paths since those are for local includes and this is a global include.