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

iOS: Firebase.h not found

Open bitfabrikken opened this issue 9 years ago • 52 comments

I've just followed the IOS guide step by step, running pod install etc. But when I open the workspace in Xcode, the line I added in AppDelegate.m shows the error "Firebase.h file not found". Any ideas on how to remedy this?

screen shot 2017-06-23 at 10 19 31

bitfabrikken avatar Jun 23 '17 08:06 bitfabrikken

Can you first close xcode, then delete the . xcworkspace & Podfile.lock files in the ios directory, then rerun pod install... see if that helps?

Ehesp avatar Jun 23 '17 11:06 Ehesp

@Ehesp Just tried it, same problem, it still shows "Firebase.h not found" for the "#import <Firebase.h>" line in AppDelegate.m

bitfabrikken avatar Jun 26 '17 06:06 bitfabrikken

In Build Settings, try modifying your Header Search Paths to include: $(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase

BuffMcBigHuge avatar Jun 26 '17 21:06 BuffMcBigHuge

@BuffMcBigHuge no luck. It was already added, and I even tried adding the node_modules dir entirely with recursive set. It still doesn't find Firebase.h in AppDelegate.m

bitfabrikken avatar Jun 27 '17 05:06 bitfabrikken

@bitfabrikken, I had the same problem and was able to solve it.

In Build Settings, try modifying your Header Search Paths to include: "$PODS_CONFIGURATION_BUILD_DIR/Firebase"

If your Firebase.h file is at ios/Pods/Firebase/Core/Sources/Firebase.h like mine, that should work.

brianhiss avatar Jul 01 '17 11:07 brianhiss

Thanks @brianhiss , just tried it, but sadly it doesn't work either.

bitfabrikken avatar Jul 01 '17 11:07 bitfabrikken

@bitfabrikken, make sure when you add that to your Header Search Paths, it's recursive.

screen shot 2017-07-01 at 8 43 59 pm

If that doesn't work, right-click on your Firebase.h file from your screenshot, and see where the file is located. Add that to your path.

In Xcode menu, go to Product -> Clean to clear out any cache.

brianhiss avatar Jul 01 '17 11:07 brianhiss

Is there a text file those entries can be edited in? I think there must be something wrong with mine, as there's a whole bunch of lines that are just ode_modules and other lines seeming to miss the first character

bitfabrikken avatar Jul 03 '17 17:07 bitfabrikken

You could edit your ios/dagligkrydsen.xcodeproj/project.pbxproj file directly, but I would highly advise against it. You could corrupt it further. Make a backup first if you take this approach.

Go to ios/dagligkrydsen.xcodeproj and right-click, "Show Package Contents" to get to the project.pbxproj file.

Seems like your file is corrupted already. Are you adding this to an existing project, or you start fresh? Might want to start fresh and see if you can't get it to work from a new install.

brianhiss avatar Jul 04 '17 01:07 brianhiss

Thanks for all the help @brianhiss , really appreciate it :) I got it working now, with a new project. Any idea how to regenerate all the xcode files for ios in this troublesome project of mine?

bitfabrikken avatar Jul 04 '17 04:07 bitfabrikken

@bitfabrikken That's hard to say without seeing it. Best to make that backup of the whole project and try all sorts of things, that's the best way to learn.

1

You might try to upgrade the React Native project first:

  • npm install -g react-native-git-upgrade
  • react-native-git-upgrade

Resolving the conflicts from your upgrade could be bad if you have corrupt files.

2

And/or, you can start with deleting the node_modules, ios/Pods and ios/build folders. Just before reinstalling, I'd make sure my package.json is accurate and up to date along with the ios/Podfile file. I'd then reinstall the Pods cd ios && pod install and the Node packages npm install.

3

If for some reason you have a corrupt project, you can always start a new one. Copy your dependencies from your package.json, copy your ios/Podfile, copy your index.ios.js source code and other js source code you might have, and run cd ios && pod install and the Node packages npm install. That should get you back to a fresh project, running the latest react native.

brianhiss avatar Jul 04 '17 05:07 brianhiss

I finally got it to compile :) Turns out I had to remove all the header search path entries, and just have the $inherited one! Thanks again @brianhiss :)

bitfabrikken avatar Jul 04 '17 06:07 bitfabrikken

@bitfabrikken That did not work for me.

alxvallejo avatar Aug 23 '17 15:08 alxvallejo

Didn't work for me either, I'm stuck here. File is present where it should be, but it keeps complaining "Firebase.h file not found"

jorgesc avatar Aug 24 '17 20:08 jorgesc

Me too :( I have just try all way but no luck

tux89 avatar Nov 12 '17 09:11 tux89

@jorgesc try to clean xcode cache

socksrust avatar Feb 28 '18 17:02 socksrust

For future folks with this problem on install, see section 2 of the troubleshooting part of the install docs.

chloerice avatar Apr 25 '18 04:04 chloerice

What @chloerice said, and make sure you're switching from .xcproj to .xcworkspace and working there from now on. Did the trick for me

kevinEsherick avatar May 09 '18 22:05 kevinEsherick

I happened to have come across FirebaseCore/FirebaseCore.h not found by erroneously opening the normal Xcode project and not the xcworkspace. By switching projects error faded.

Khaledonian avatar Jun 21 '18 07:06 Khaledonian

I have done some of the workaround's but it work for just simulator, but now i need to tested and few errors appear, i could solve some of the but the file isn't located has the same for android... different errors, but come from the same side. what was the new workarounds? i'm using the 0.5.11 version.

Julio-andre avatar Nov 22 '18 18:11 Julio-andre