React-native-firebase: RNFirebase.m:2:9: 'FirebaseCore/FirebaseCore.h' file not found

Created on 16 Nov 2017  ยท  30Comments  ยท  Source: invertase/react-native-firebase

Issue

I have followed the installation guide exactly. I got Android configured but iOS is being more temperamental. When I attempt to build it in XCode I get the following error inside the RNFirebase Xcode project.

<RN project root>/node_modules/react-native-firebase/ios/RNFirebase/RNFirebase.m:2:9: 
'FirebaseCore/FirebaseCore.h' file not found

screen shot 2017-11-16 at 10 55 17 am

The one deviation I made was to use the Integrate without CocoaPods procedure which involves manually linking the Frameworks to your XCode project so I followed the Firebase readme to link the proper framework packages. That solved my initial error of the Firebase.h header file not being found by my AppDelegate file but now I just need to get past this error of the actual RNFirebase XCode project not seeing the framework.

screen shot 2017-11-16 at 11 00 47 am

I tried rerunning the react-native link command but that yielded no fruit and it seems like it would be bad for me to manually go in and link it.

screen shot 2017-11-16 at 11 03 39 am

So how do I get the RNFirebase project to see the framework files? The #import <FirebaseCore/FirebaseCore.h> statement is causing the issue.

Environment

  • OS: macOS Sierra 10.12.6
  • Node: 7.9.0
  • Yarn: 1.0.2
  • npm: 5.5.1
  • Watchman: 4.7.0
  • Xcode: Xcode 9.1 Build version 9B55
  • react: 16.0.0-beta.5
  • react-native: 0.49.5
  • RNFirebase Version: 3.1.0
  • Firebase Module: N/A
iOS Waiting for User Response

Most helpful comment

I have the same issue what should I do please suggest.

image

All 30 comments

@adamfisher This might be an oversight on our part - the support for standalone frameworks has been merged but not released, even though the docs have been updated.

Could you try installing from the latest version and seeing if that works:

npm install --save https://github.com/invertase/react-native-firebase

I ran the following commands but I still get the same error during build in XCode. I made sure to do a clean and then complete rebuild.

6000760mac:MobileApp user1$ yarn add https://github.com/invertase/react-native-firebase

yarn add v1.0.2
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
[3/4] ๐Ÿ”—  Linking dependencies...
warning "[email protected]" has incorrect peer dependency "fbjs@*".
warning "[email protected]" has incorrect peer dependency "babel-core@^6.0.0 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0".
[4/4] ๐Ÿ“ƒ  Building fresh packages...
success Saved 1 new dependency.
โ””โ”€ [email protected]
โœจ  Done in 4.75s.


6000760mac:MobileApp user1$ react-native link react-native-firebase

Scanning folders for symlinks in <RN Project Root>/node_modules (7ms)
rnpm-install info Android module react-native-firebase is already linked
rnpm-install info iOS module react-native-firebase is already linked
rnpm-install info Linking assets to ios project
rnpm-install info Linking assets to android project
rnpm-install info Assets have been successfully linked to your project

Which directory have you added your frameworks to?

They are in the root of the ios folder that React Native creates.

Try popping them in a Firebase folder as explained in the docs: https://rnfirebase.io/docs/v3.1.*/installation/ios#4.-Setup-Firebase-Pods

๐Ÿคฆโ€โ™‚๏ธ Oh man that was easy. Thank you so much! creating a Firebase folder at the root of the ios folder and adding them into there did the trick! Thank you.

No problem, glad it worked!!

Still getting this error.

By placing the frameworks within a Firebase folder at the root of the ios folder you mean this conf?
screen shot 2017-11-22 at 8 57 39 am

I'm having the same issue.

@chrisbianca your fix is not possible for people with npm 5 since npm 5 break post_install script making the install from source not possible.
When do you guys plan on releasing the new build?

I don't understand, the doc is for version 3.1 and npm originally builds 3.1, why should we build from master?
It should work properly with 3.1?

If so same question as @BricePissard above.
Creating a firebase folder with the librairies and adding the folder to the project doesn't work.

@tirrorex which fix?

@chrisbianca gonna open my own issue

I have the same issue what should I do please suggest.

image

we are experiencing the same issue
tried integrating using:
pod "Firebase/Core"
as described here: https://rnfirebase.io/docs/v3.1.*/installation/ios#4.-Setup-Firebase-Pods
but the problem wasn't solved
anybody managed to solve this issue?

Solved.

  • Make sure your pods are updated and installed.
  • Fix any pods errors. I had a missing target target 'MyAppTests'. Once I removed, all was good.

Using:
"react": "^16.2.0", "react-native": "^0.51.0", "react-native-firebase": "^3.2.2",

My podfile is using:
platform :ios, '9.3'
One of these commands help fix the 'FirebaseCore.h' not found.
cd ios pod outdated pod update pod install

i have configured firebase for my react-native app "only for android part" it works really cool, But when i run my project to get the new build the Xcode throws some issues while building the app "though i haven't configured firebase for ios part"

please find the attachments
issue2
issue1

@policz
Hello, I am facing the same issue. Do you get any solution?

Inside RNFirebaseUtil.h file , 'Firebase.h' file not found error occur.
Anybody knows how to solve this problem? Thanks..

screen shot 2018-05-22 at 12 46 51 pm

i am also facing same issue 'FirebaseCore/FirebaseCore.h' file not found
screen shot 2018-05-29 at 8 15 54 am

In my experience deleting the Pods directory and Porfile.lock, then running 'pod install' again will fix this issue. But I don't know why it appears in the first place and how to permanently resolve it.

Did anyone find solution? Facing the same issue

I eventually did. I gave up on Cocoapods installation after the problem kept coming back, and just included Firebase manually (look at the Firebase installation guide). After that no more issues.

Thanks @r00li!
Actually I was just able to solve it (finally) by removing the use_frameworks from the pod file, while using a 1.5+ version of cocoa pods, and adding the , :modular_headers => true for specific pods which depends on Obj-C code.

More info can be found here:
http://blog.cocoapods.org/CocoaPods-1.5.0/

Solved

Install pod 'FirebaseCore' instead of pod 'Firebase/Core'

@bhavneet0812
I think your solution is not working. RNFirebase Version v5.x.x

In my case, from toolbar, click File -> Save As Workspace, then close the project and open the .xcworkspace file. This will include missing files from relative paths to the workspace

I'm getting the same error only in CI no matter what pod version I used. Tried: 4.11/4.13/latest ver still same.

pod 'Firebase/Core'
pod 'Firebase/Messaging'

/Users/vagrant/git/node_modules/react-native-firebase/ios/RNFirebase/RNFirebaseUtil.h:6:9: 'Firebase.h' file not found


Update:

Did pod deintegrate and pod install managed to solve my problem

I eventually did. I gave up on Cocoapods installation after the problem kept coming back, and just included Firebase manually (look at the Firebase installation guide). After that no more issues.

I did the same, but the issue is still there. I've read the installation guide(many times).
I had a pod configuration for other dependencies, but I removed the Pod settings. Maybe Im missing something.

Any place to look at? or configuration I might be doing wrong?

Having the same problem while installing it manually.
screen shot 2019-01-24 at 4 13 14 pm
screen shot 2019-01-24 at 4 14 37 pm

@tenchoklang You don't need to add the header file "Firebase.h" to Link Binary With Libraries, you should even remove it from there. But if your followed the manual installation steps you had been thru this steps:

  1. yarn add react-native-firebase
  2. Download the fat Firebase SDK
  3. Drag all the frameworks in Analytics, select copy if needed, select the target too
  4. Drag the header file Firebase.h to your project.
  5. run react-native link react-native-firebase
  6. Add the initialization code to your app delegate.

I don't know the reason you choose to do it manually, personally I'm not fan of use cocoapods, but I admit it has lots of benefits, so if you don't want to get a headache as me 3 days ago, you should use pods.

I was told not to use cocoapods at work. I was able to SOLVE the issue by following the steps here HERE

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TalEliel picture TalEliel  ยท  48Comments

elledienne picture elledienne  ยท  55Comments

tranty9597 picture tranty9597  ยท  79Comments

OleksandrKucherenko picture OleksandrKucherenko  ยท  46Comments

abdullahizzuddiin picture abdullahizzuddiin  ยท  80Comments