After adding react-native-firebase to my iOS project it failes to build. I added it by copying the example podfile as shown below.
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'
When trying to build I get the following error:
/ios/Pods/Firebase/Core/Sources/Firebase.h:1:9: 'FirebaseAnalytics/FirebaseAnalytics.h' file not found
Any help would be appreciated
Check out #76, seems to be a duplicate issue. No one answered there yet, but you should try to consolidate this down to one issue.
@Jorrit2002 @erikaxel @SteffeyDev could you drop your Podfile.lock
file and your Pods directory and re-install pods - looks like a firebase sdk issue
I have tried this several times, kill Podfile and Pods and full rebuild, but didn't get it to work. I also tried using the native-link method, but then I run into issues with the react headers. It is a bit unclear from the documentation, but are you supposed to do either the pod include, or the native-link or both?
The same for me, it didn't solve the problem.
I don't have this issue, but as both #76 & #77 are citing the same error perhaps we should reduce down to one issue while it is being worked on.
Yes, I think these are the same issues. I will close #76, so we can continue to comment on this one.
I have found one way to work around this issue, but it involves manually importing both the React framework and RNFirebase instead of using the cocoapods. This however seems quite fragile, and as an example I can not get react-native run-ios to work, but only run it from the xcode project itself. It would be great if this can be solved.
In case it is unclear how to create a minimum case:
Now you should see the same compile errors as we do.
PS: Thanks for the quick fixes in the docs which clarify the install options.
cc @chrisbianca
Is anybody still struggling with this issue?
Yup, still doesn't work. I have followed the steps I outlined above, and created an example repo:
https://github.com/erikaxel/react-native-firebase-example
This was created very quick and dirty, but it shows the compile errors we get. To test it, just open the xcworkspace project in XCode and press run. If you remove the react-native-firebase pods and do an pod install, the errors disappear. It uses RN 0.45.1, and react-native-firebase 1.1.0.
The app itself doesn't do anything or try to initialise firebase-react-native, but that doesn't really matter. Im certain that if the compile errors are fixed, the rest will work.
The compile error is the same as in issue #154
Yup, hit this one too. I guess I will be developing in Android until we get a fix!
Very strange one this, I'll clone your repo today and check it out.
On 12 Jun 2017 2:15 am, "BuffMcBigHuge" notifications@github.com wrote:
Yup, hit this one too. I guess I will be developing in Android until we
get a fix!—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/invertase/react-native-firebase/issues/77#issuecomment-307670057,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAzZXltEb4SMk4a3JFFSoG9IYPSqCEs0ks5sDJEogaJpZM4NNZZl
.
What react native version are you guys running?
Can you try trash your pods directory and the podlock file then re run pod install?
I'm running:
react 16.0.0-alpha.6
react-native 0.44.2
Tried trashing pods dir and podlock, same result.
pod file:
target 'sample' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
# Pods for 'sample'
end
# RNFirebase
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'
Manifest.lock
PODS:
- Firebase/Analytics (3.17.0):
- Firebase/Core
- Firebase/AppIndexing (3.17.0):
- Firebase/Core
- FirebaseAppIndexing (= 1.2.0)
- Firebase/Auth (3.17.0):
- Firebase/Core
- FirebaseAuth (= 3.1.1)
- Firebase/Core (3.17.0):
- FirebaseAnalytics (= 3.9.0)
- FirebaseCore (= 3.6.0)
- Firebase/Crash (3.17.0):
- Firebase/Core
- FirebaseCrash (= 1.1.6)
- Firebase/Database (3.17.0):
- Firebase/Core
- FirebaseDatabase (= 3.1.2)
- Firebase/DynamicLinks (3.17.0):
- Firebase/Core
- FirebaseDynamicLinks (= 1.4.0)
- Firebase/Messaging (3.17.0):
- Firebase/Core
- FirebaseMessaging (= 1.2.3)
- Firebase/RemoteConfig (3.17.0):
- Firebase/Core
- FirebaseRemoteConfig (= 1.3.4)
- Firebase/Storage (3.17.0):
- Firebase/Core
- FirebaseStorage (= 1.1.0)
- FirebaseAnalytics (3.9.0):
- FirebaseCore (~> 3.6)
- FirebaseInstanceID (~> 1.0)
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- FirebaseAppIndexing (1.2.0)
- FirebaseAuth (3.1.1):
- FirebaseAnalytics (~> 3.7)
- GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)
- GTMSessionFetcher/Core (~> 1.1)
- FirebaseCore (3.6.0):
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- FirebaseCrash (1.1.6):
- FirebaseAnalytics (~> 3.7)
- FirebaseInstanceID (~> 1.0)
- GoogleToolboxForMac/Logger (~> 2.1)
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- Protobuf (~> 3.1)
- FirebaseDatabase (3.1.2):
- FirebaseAnalytics (~> 3.7)
- FirebaseDynamicLinks (1.4.0):
- FirebaseAnalytics (~> 3.9)
- FirebaseInstanceID (1.0.10):
- FirebaseCore (~> 3.6)
- FirebaseMessaging (1.2.3):
- FirebaseAnalytics (~> 3.8)
- FirebaseInstanceID (~> 1.0)
- GoogleToolboxForMac/Logger (~> 2.1)
- Protobuf (~> 3.1)
- FirebaseRemoteConfig (1.3.4):
- FirebaseAnalytics (~> 3.7)
- FirebaseInstanceID (~> 1.0)
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- Protobuf (~> 3.1)
- FirebaseStorage (1.1.0):
- FirebaseAnalytics (~> 3.7)
- GTMSessionFetcher/Core (~> 1.1)
- GoogleToolboxForMac/DebugUtils (2.1.1):
- GoogleToolboxForMac/Defines (= 2.1.1)
- GoogleToolboxForMac/Defines (2.1.1)
- GoogleToolboxForMac/Logger (2.1.1):
- GoogleToolboxForMac/Defines (= 2.1.1)
- GoogleToolboxForMac/NSData+zlib (2.1.1):
- GoogleToolboxForMac/Defines (= 2.1.1)
- GoogleToolboxForMac/NSDictionary+URLArguments (2.1.1):
- GoogleToolboxForMac/DebugUtils (= 2.1.1)
- GoogleToolboxForMac/Defines (= 2.1.1)
- GoogleToolboxForMac/NSString+URLArguments (= 2.1.1)
- GoogleToolboxForMac/NSString+URLArguments (2.1.1)
- GTMSessionFetcher/Core (1.1.10)
- Protobuf (3.3.0)
- RNFirebase (1.1.0)
DEPENDENCIES:
- Firebase/Analytics
- Firebase/AppIndexing
- Firebase/Auth
- Firebase/Core
- Firebase/Crash
- Firebase/Database
- Firebase/DynamicLinks
- Firebase/Messaging
- Firebase/RemoteConfig
- Firebase/Storage
- RNFirebase (from `../node_modules/react-native-firebase`)
EXTERNAL SOURCES:
RNFirebase:
:path: ../node_modules/react-native-firebase
SPEC CHECKSUMS:
Firebase: 4b66b5b59c43edac745b87f0c87e42cdd0279c13
FirebaseAnalytics: e5fe8486efc01bec33f6bf82e2fa9fce4b124052
FirebaseAppIndexing: adf2f3b14b6828f1d4c539fc72434962cf29ea2c
FirebaseAuth: cc8a1824170adbd351edb7f994490a3fb5c18be6
FirebaseCore: 9691ee2ade70c098d7cf92440f4303f16d83ca75
FirebaseCrash: db4c05d9c75baa050744d31b36357c8f1efba481
FirebaseDatabase: 05c96d7b43a7368dc91c07791adb49683e1738d1
FirebaseDynamicLinks: 0dbfd974f560dd1bda7498afc24697adb5cce72f
FirebaseInstanceID: b9eedd6846fb5e1f0f7279e1deaa7a7e4cf8392e
FirebaseMessaging: 753d05a925e9eb8eadd09a0ffc9b808578b72fac
FirebaseRemoteConfig: af3003f4e8daa2bd1d5cf90d3cccc1fe224f8ed9
FirebaseStorage: a5c55b23741a49a72af8f30f95b3bb5ddbeda12d
GoogleToolboxForMac: 8e329f1b599f2512c6b10676d45736bcc2cbbeb0
GTMSessionFetcher: 30d874b96d0d76028f61fbd122801e3f030d47db
Protobuf: d582fecf68201eac3d79ed61369ef45734394b9c
RNFirebase: 2c5288b0cbb62c22f22a3278e8131b3a5ec9f572
PODFILE CHECKSUM: a9dac2cc3646baa46ad8e23265b1f80feec1f0ab
COCOAPODS: 1.2.1
In my project RN 0.44.2, in the example github I posted it is 0.45, the error the same. Clearing the project pods does not change anything unfortunately.
The example project is meant as a minimal case, please let me know if there is anything unclear about it, or if you would like me to change anything it.
Thanks for looking into this!
The same issue with not found firebase.h while building with xcode
@erikaxel I'm trying your project out now. Having some fun xcode issue but from the outset it looks like Firebase has not been configured in the AppDelegate.swift
file?
Once I've sorted xcode out I'll keep looking into it.
@brobx @erikaxel @BuffMcBigHuge @Jorrit2002 Guys are you sure you're configuring Firebase in your AppDelegates? I've just cloned the example repo from erikaxel and it doesn't have this.
EDIT: Removed incorrect comment regarding subspecs.
I have been fighting this issue for the past 4 days and somehow it has solved itself minutes ago.
My only guess is the Podspec.template change made it to cocoa repositories or something.
I've been unsuccessful in breaking the porject back.
@Ehesp my project builds fine now with explicit subspecs (those are recommended in the RN docs) and without AppDelegate changes (this is wrong but would only manifest at run time not during the build process)
@Jorrit2002 @erikaxel This command now gives me a working app
react-native init FireDrill2 && cd FireDrill2 && yarn add react-native-firebase && react-native link react-native-firebase && react-native run-ios
(it lacks the GoogleService-info.plist and AppDelegate modifications, but those are well documented)
Like I've said it used to produce an error about FirebaseAnalytics.h on my machine but not anymore.
I don't mind sharing a sample project if you guys want to run a diff or try building it with your xcode.
I was able to solve the issue by doing the following:
Ensure you drag your GoogleServices-Info.plist into your app directory in Xcode.
Ensure your podfile has the following:
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'
After running pod install
, restart Xcode.
@chrisbianca has updated the ios docs, generally seems like react-native link
is the culprit - the docs address this and shows manual install steps (not as daunting as it sounds).
Thanks all for flagging this and helping us investigate, hopefully the updated docs will save headaches for others.
Question: Therefore it's recommended to run react-native unlink react-native-firebase
after running react-native link
(for other package dependencies)?
@BuffMcBigHuge for now I'd guess so yes. We can remove linking scripts in the next release so that unlink is no longer needed.
Should also be removing the need for plist/json google services file in a later release - so thats one less setup step. Also have plans to make a starter
repo that people can just clone and get started with straight away. Hopefully those two things will help initial setup in the long run.
@Salakar the linking scripts have already been removed, we just need to release a new version and then there should be no need to run react-native unlink react-native-firebase
@BuffMcBigHuge I'll try and get a minor release out today
@BuffMcBigHuge v1.1.1 is now out which means you shouldn't need to unlink react-native-firebase explicitly https://github.com/invertase/react-native-firebase/releases/tag/v1.1.1
This error can happen is you try to use podfile with use_frameworks.
@MoOx can you please elaborate? I'm having this issue and I'm using both
for those who is still having this issue and using cocoapods.
Try downgrading your cocoapods to a lower version. I was having this issue when i upgrade to latest version.
you probably didnt open the workspace file instead you opened the other one
Most helpful comment
Is anybody still struggling with this issue?