react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

RNFirebase.m:2:9: 'FirebaseCore/FirebaseCore.h' file not found

Open adamfisher opened this issue 9 years ago • 30 comments

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

adamfisher avatar Nov 16 '17 16:11 adamfisher

@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

chrisbianca avatar Nov 16 '17 16:11 chrisbianca

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

adamfisher avatar Nov 16 '17 16:11 adamfisher

Which directory have you added your frameworks to?

chrisbianca avatar Nov 16 '17 16:11 chrisbianca

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

adamfisher avatar Nov 16 '17 19:11 adamfisher

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

chrisbianca avatar Nov 16 '17 20:11 chrisbianca

🤦‍♂️ 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.

adamfisher avatar Nov 16 '17 20:11 adamfisher

No problem, glad it worked!!

chrisbianca avatar Nov 16 '17 20:11 chrisbianca

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

BricePissard avatar Nov 22 '17 08:11 BricePissard

I'm having the same issue.

mtx62 avatar Nov 24 '17 02:11 mtx62

@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 avatar Dec 05 '17 13:12 tirrorex

@tirrorex which fix?

chrisbianca avatar Dec 05 '17 14:12 chrisbianca

@chrisbianca gonna open my own issue

tirrorex avatar Dec 05 '17 14:12 tirrorex

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

image

uc-asa avatar Jan 09 '18 03:01 uc-asa

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?

pilot4u avatar Jan 14 '18 21:01 pilot4u

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

esutton avatar Jan 28 '18 15:01 esutton

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 avatar Apr 13 '18 18:04 policz

@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

GoNishant avatar May 22 '18 07:05 GoNishant

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

somsin avatar May 29 '18 02:05 somsin

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.

r00li avatar Jun 08 '18 06:06 r00li

Did anyone find solution? Facing the same issue

oferRounds avatar Jul 13 '18 07:07 oferRounds