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?
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 Just tried it, same problem, it still shows "Firebase.h not found" for the "#import
In Build Settings, try modifying your Header Search Paths to include:
$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase
@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, 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.
Thanks @brianhiss , just tried it, but sadly it doesn't work either.
@bitfabrikken, make sure when you add that to your Header Search Paths, it's recursive.
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.
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
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.
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 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.
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.
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
.
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
.
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 That did not work for me.
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"
Me too :( I have just try all way but no luck
@jorgesc try to clean xcode cache
For future folks with this problem on install, see section 2 of the troubleshooting part of the install docs.
What @chloerice said, and make sure you're switching from .xcproj to .xcworkspace and working there from now on. Did the trick for me
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.
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.
How can i fix this issue ?
This issue should re-opened
@Kottidev did u find any solution?
What worked for me with react-native-firebase
and a many others libs is adding to my Podfile
:
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
. After run pod install
.
I don't know what happens. I have react-native
+ ExpoKit (detach expo)
+ tons of 3rd-party libs
. react-native link is just not doing its job properly and I have to update Podfile manually. Which for it lib I add to my project become a really mess..
Its surprising this issue is still there . followed a guide from here and also referred to official doc , I have used firebase sdk with iOS so I am pretty much sure I have followed all the steps correct. Still project opened in Xcode 10 can't find firebase.h file and build fails. Not sure how to use RNFirebase in RN project now.
This issue should be reopened, no solution listed above worked for me , tried changing header search path to even exact location but Xcode will never see firebase.h file. Also did several reinstalls of pod multiple times, cleaning build , deleting derived data folder.
@vdharankar Did you try to pod deintegrate
before reinstall the pod? Mine was the pod issue and manage to be fixed by running the code.
What helped me was to add
https://github.com/invertase/react-native-firebase-starter/blob/master/ios/Podfile
to your Podfile and then do pod install.. You should comment out what you don't need / use
What worked for me with
react-native-firebase
and a many others libs is adding to myPodfile
:
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
. After runpod install
.I don't know what happens. I have
react-native
+ExpoKit (detach expo)
+tons of 3rd-party libs
. react-native link is just not doing its job properly and I have to update Podfile manually. Which for it lib I add to my project become a really mess..
thank you, seems like i forget to add RNFirebase to the pod file, after add it and pod install
it works again :)
In the referenced issue, there is a solution for this issue with just a few lines at the end of your Podfile
:
post_install do |installer|
system("mkdir -p Pods/Headers/Public/FirebaseCore && cp Pods/FirebaseCore/Firebase/Core/Public/* Pods/Headers/Public/FirebaseCore/")
end
I had to use this script as the other workarounds were not stable on our CI builds. This script basically moves the header files from where they are installed by cocoapods to where they are expected by RNFirebase. There is no need to add react-native-firebase to your Podfile to resolve this. There are several workarounds, but this issue is definitely still around in the latest version. @Salakar would you consider reopening?
In the referenced issue, there is a solution for this issue with just a few lines at the end of your
Podfile
:post_install do |installer| system("mkdir -p Pods/Headers/Public/FirebaseCore && cp Pods/FirebaseCore/Firebase/Core/Public/* Pods/Headers/Public/FirebaseCore/") end
I had to use this script as the other workarounds were not stable on our CI builds. This script basically moves the header files from where they are installed by cocoapods to where they are expected by RNFirebase. There is no need to add react-native-firebase to your Podfile to resolve this. There are several workarounds, but this issue is definitely still around in the latest version. @Salakar would you consider reopening?
after applying your solution, I m able to build the project successfully and also publish on testflight, but the app crash immediately when it's open.
any idea why ?
In the referenced issue, there is a solution for this issue with just a few lines at the end of your
Podfile
:post_install do |installer| system("mkdir -p Pods/Headers/Public/FirebaseCore && cp Pods/FirebaseCore/Firebase/Core/Public/* Pods/Headers/Public/FirebaseCore/") end
I had to use this script as the other workarounds were not stable on our CI builds. This script basically moves the header files from where they are installed by cocoapods to where they are expected by RNFirebase. There is no need to add react-native-firebase to your Podfile to resolve this. There are several workarounds, but this issue is definitely still around in the latest version. @Salakar would you consider reopening?
after applying your solution, I m able to build the project successfully and also publish on testflight, but the app crash immediately when it's open.
any idea why ?
You should install Fabric on your App and check the stack trace
@YahiaYasLife try building locally with the "Release" Build configuration on Run (manage schemes to get here)
If you are able to reproduce the error that way, you should be able to see a stack trace in your Xcode log output for the run.
I had this error additional times (as I remember).
Today I notice what exactly I've done to fix it:
If you like, you better could clean
your Project and close XCode - but for me the above steps are enough to solve it.
For me it was just /Pods, thanks
same for me, please help
@edritech93 you must add FirebaseCore.h to the search headers path.
In my case, after try with all of responses posted here, I added the following two paths:
and it works! You can find the correct locations of these files using a command like this:
find ./ -name "FirebaseCore.h"
Let me know if your case is solved.
monorepo
users have to nohoist
react-native-firebase package:
"workspaces": {
"packages": [
"packages/*"
],
"nohoist": [
"**/react-native-firebase"
]
}
Solved
On Sat, Mar 23, 2019, 07:41 rafacgarciaa notifications@github.com wrote:
@edritech93 https://github.com/edritech93 you must add FirebaseCore.h
to the search headers path.
In my case, after try with all of responses posted here, I added the
following two paths:
- ${PODS_ROOT}/Headers/Public (for file FirebaseCore.h)
- ${PODS_ROOT}/Firebase/CoreOnly/Sources (for Firebase.h)
and it works! You can find the correct locations of these files using a
command like this:find ./ -name "FirebaseCore.h"
Let me know if your case is solved.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/invertase/react-native-firebase/issues/198#issuecomment-475824038,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AgX_m0_vSj3_2ik8LH3F-JhKQxM6VV_Kks5vZXg8gaJpZM4ODRXV
.
This occurred in my Project and I assume its due to fact that I opted to install Firebase through Carthage instead of Cocoapods for iOS project.
Adding these lines:
$(SRCROOT)/../../../ios/Carthage/Build/iOS/
to Framework search paths
And
$(SRCROOT)/../../../ios/Carthage/Build/iOS/Firebase.framework/Headers
to Header search Paths
inside RNFirebase
project fixed the issue. Although I'm not quite happy that I had to modify project file (which is gone when node_modules folder is deleted). On the other hand I was able to get it compiling without introducing Cocoapods.
@ajanauskas then you will love the patch-package package https://github.com/ds300/patch-package#readme
I use this for the very rare times I need to modify a file that upstream is either not interested in or just hasn't released yet. I feel the implementation of the patching - where they patch-package tracks the underlying package version and supply very clear information about whether the patch is good or not and what you need to do to track it is excellent.
My mistake was that my Podfile was not in the /ios folder, but rather /ios/projectname/.
In my case, it was the FRAMEWORK_SEARCH_PATHS
. As suggested by pod install, just add $(inherited) and things work again.
In my case, $(inherited)
was missing from HEADER_SEARCH_PATHS
(add to the top)
Try also to comment use_frameworks!
in your Podfile
.
pod install
Unable to find a target named ReactPushNotifications
Here is a demonstration going from nothing to a full react-native-firebase install including the currently required patch in the Podfile for headers https://github.com/mikehardy/rnfbdemo
im still have problem with this :(
try run react-native upgrade.
it worked for me when I encountered this error.
In my case I did what suggested @xstable and I removed :
use_frameworks!
from Podfile.
I'm using v6 and found this helpful: https://github.com/invertase/react-native-firebase/issues/2234#issuecomment-502016436
Basically, in your Podfile add:
require_relative '../node_modules/@react-native-firebase/app/pod_config'
and
react_native_firebase!
Then
$ rm -rf YOUR_PROJECT_NAME.xcworkspace && rm Podfile.lock
$ pod install
In your Xcode do the following changes:
1:Click your root project:
2:On Right Bar Navigate to BuildSetting
3:Search Header Search Paths:
4:Add these path inside
Debug ,Relase && Stage:
"$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase/notifications"
"$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase/messaging"
$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase
@StarkAndy careful with that advice - this is an old issue, that advice is no longer needed (I demonstrate as much in the rnfbdemo project above) and some people may not even have a Stage target, implying your advice is project-specific. I'm going to lock this thread as it's solved and none of the advice should be required with current versions
Most helpful comment
Can you first close xcode, then delete the
. xcworkspace
&Podfile.lock
files in theios
directory, then rerunpod install
... see if that helps?