react-native-firebase-analytics
react-native-firebase-analytics copied to clipboard
iOS build / installation error
React Native version: 0.40 Error:
/node_modules/react-native-firebase-analytics/ios/RNFIRAnalytics.h:4:9: fatal error: 'FirebaseCore/FIRApp.h' file not found
#import <FirebaseCore/FIRApp.h>
^
1 error generated.
** BUILD FAILED **
The following build commands failed:
CompileC /Users/Enes/RN/Tviz/ios/build/Build/Intermediates/RNFIRAnalytics.build/Debug-iphonesimulator/RNFIRAnalytics.build/Objects-normal/x86_64/RNFIRAnalytics.o RNFIRAnalytics.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Check if you have react-native-firebase-analytics v2.0.0 or v3.0.0 installed.
Also check if you installed Firebase Analytics through POD.
Make sure you imported Firebase in AppDelegate.m @import Firebase;
I have same issue. I'll try @damir-sirola suggestion. Anyway, I'm curious why no mention in readme to install react-native-firebase-analytics
I also have this issue, I installed react-native-firebase-analytics also but it doesn't help me.
I downgraded to 0.39. but using pods solved my issue (in 0.40), just type pod update few times, reset everything etc. @phoenix214
I hit the same error. I'm on RN 0.41.2 and latest of this package.
The solution after much poking around:
@import Firebase;
at top of AppDelegate.m
(as mentioned by @damir-sirola)
But also, I found I needed to comment out all the unused targets in Podfile
or compiling would fail too, like so:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target '<app_name>' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for <app_name>
pod 'Firebase/Core'
# target '<app_name>-tvOSTests' do
# inherit! :search_paths
# # Pods for testing
# end
#
# target '<app_name>Tests' do
# inherit! :search_paths
# # Pods for testing
# end
end
#target '<app_name>-tvOS' do
# # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# # use_frameworks!
#
# # Pods for <app_name>-tvOS
#
# target '<app_name>-tvOSTests' do
# inherit! :search_paths
# # Pods for testing
# end
#
#end
@evollu, README can use some updating with these 2 bits for other users? Thanks for this package.
As an aside, I'm using this package in conjunction with CodePush. I'm currently stuck where building this in XCode with a Staging
config (duplicate from Release), to a physical device, the build would fail. Building the same to the simulator however succeeds. Release
and Debug
builds to both device and simulator would succeed. Can't figure out why the Staging build to device fails.
@fungilation it depends on how your integrate firebase with your solution
@import Firebase;
only works for pod integration
I will update readme later
use #import <Firebase/Firebase.h> instead of @import Firebase, it work for my (React-native 0.42)
@Mactub07 does not work if you're using frameworks
I use frameworks myself
I just have #import "RNFIRMessaging.h"
only in my appdeletegate.m
If I have use_frameworks!
and that import only in my appdelegate.m, I get the FirebaseCore/FIRApp.h error noted in the first comment.
Using react-native 0.43.1
what firebase iOS version are you using? I remember 4.0 introduced breaking change so this repo isn't compatible with that
yea i saw the recent note, so am using 3.16.0
I figured it out finally. See my notes on https://github.com/evollu/react-native-fcm/issues/377, which is the same problem, but on your other package, react-native-fcm.
Where is inherit! :search_paths?
inherit! :search_paths is a directive you can use in a Podfile. another react-native module called tipsi-stripe requires it to be in your Podfile but seems to conflict with react-native-fcm. My guess is that on link time, the linker can't find the firebase headers in the Pod-provided search paths if that directive is on.
I tried the following:
-
#import <Firebase/Firebase.h> instead of #import 'firebase.h'
in my bridging header ( as I am using Swift) - Changed my Pod file to reference Firebase version 3.16 like below:
pod 'Firebase', '~> 3.16', :subspecs => [
'Analytics',
'Messaging',
]
- I do not have inherit! :search_paths in my Podfile
- Added import Firebase to the header of my AppDelegate.swift
I still get the error reported by the issue Unable to find
#import <FirebaseCore/FIRApp.h>
in RNFIRMessaging.h
Any update on this issue?