Header file (FirebaseCore/FirebaseCore.h) not found, despite importing Firebase.framework
Asked Answered
F

12

36

I am trying to manually import and use the Firebase framework in my iOS application. I am starting off with the basic bare minimum Analytics framework (then I'll add the rest of the frameworks).

I followed this tutorial in order to manually import the Google Firebase framework into my Xcode project. The problem is that I am still getting the following error:

'FirebaseCore/FirebaseCore.h' file not found

I have imported the frameworks, imported the overall header file and have made sure that the files where actually copied to the project directory folder.

I have set the -ObjC linker flag too.

enter image description here

Has anyone else managed to manually import the Google Firebase framework into their Xcode project? What am I missing?

Note: I am not interested in using CocoaPods at all, I just want the simple old fashioned approach.

Forme answered 29/8, 2018 at 12:4 Comment(0)
F
6

There were two problems:

1) The instructions stated on the Google Developer website for importing the frameworks manually, are somewhat lacklustre. So I followed the following tutorial to import the frameworks and setup my developer account: http://www.mokacoding.com/blog/setting-up-firebase-without-cocoapods/

2) After you have imported all the frameworks/resources/plist files/etc... you will still get the following build error:

'FirebaseCore/FirebaseCore.h' file not found

In order to get around this issue, clean your Xcode project and then close the project. Then reopen the project and rebuild it. It will now work - perhaps the Xcode project can now see the framework files or something... not really sure, but it's the only solution that has repeatedly worked for me.

Update

I think this was just a bug with Xcode 9.x, ever since I upgraded to Xcode 10, I haven't had this issue at all. Just import all the frameworks as usual and build and run the project.

Forme answered 13/9, 2018 at 14:17 Comment(1)
I am working with Cordova iOS application, how do I fix for that project which requires this step everytime i run a build.Ephraimite
D
92

Make sure you are opening the .xcworkspace file instead of the .xcodeproj file.

I was troubleshooting for at least an hour before I determined this was my mistake, so hopefully this answer will save you some time!

Decrypt answered 13/11, 2019 at 13:44 Comment(1)
TQVM really helpful for new iOS developer like me ^_^Mullein
A
18

For those who are still struggling with this and have tried removing caches and all those files which everyone is talking about.

Basically, those who've already followed these steps:

1.) rm -rf Pods .xcworkspace && rm Podfile.lock (removing Pods directory, xcworkspace, clearing cache, removing .locks)

2.) rm ~/Library/Developers/Xcode/DerivedData

3.) pod install

But still nothing is working for you and if you're still seeing error like:-

<FirebaseCore/FirebaseCore.h> file not found

then here's what I did:

you probably have the code written in earlier xcode versions or swift and now trying to run it in new Xcode version 12 or something, and so I changed this

#import <FirebaseCore/FirebaseCore.h>

to

#import "Firebase.h"

and that issue was resolved for me. I know that this is a change in Firebase.h which you probably are not looking for, but I am posting this here in case if someone just wants to pass that error.

Ar answered 11/1, 2021 at 19:7 Comment(2)
changed #import <FirebaseCore/FirebaseCore.h> to #import "Firebase.h" worked for me ... many thanksImportunity
That worked, but now I get this error: /.pub-cache/hosted/pub.dev/firebase_auth-4.4.2/ios/Classes/Public/FLTFirebaseAuthPlugin.h:22:7 Cannot find interface declaration for 'FLTFirebasePlugin', superclass of 'FLTFirebaseAuthPlugin'Communard
E
15

Try remove the Podfile.lock file and Pods folder.

Run pod install.

This worked for me.

Embowel answered 16/7, 2019 at 19:34 Comment(0)
S
10

Please check on edit scheme -> build -> check if Find implicit Dependencies is enable. if no, enable it and rebuild.enter image description here

See the following for "edit scheme"

How to change the name of the active scheme in Xcode?

Shawnshawna answered 1/8, 2019 at 8:35 Comment(3)
Please give more infoAmandaamandi
@EliaWeiss You can fine this screen when u click on the top left near run button, You will see "edit scheme" button. And then follow the process above.Shawnshawna
I found the screen (added to the answer) any way, it doesn't solve the issue for me (was already checked)Amandaamandi
S
9

I've had this problem ever since Xcode 12 when building for the simulator

However, if I build for a real device the problem goes away

Firebase is not the only library that has this issue. There are others

My recommendation would be to just build for a real device now and wait for either apple to fix this potential Xcode bug, or the library creator (Google) to fix it on their end

Stamp answered 14/10, 2020 at 17:36 Comment(0)
F
6

There were two problems:

1) The instructions stated on the Google Developer website for importing the frameworks manually, are somewhat lacklustre. So I followed the following tutorial to import the frameworks and setup my developer account: http://www.mokacoding.com/blog/setting-up-firebase-without-cocoapods/

2) After you have imported all the frameworks/resources/plist files/etc... you will still get the following build error:

'FirebaseCore/FirebaseCore.h' file not found

In order to get around this issue, clean your Xcode project and then close the project. Then reopen the project and rebuild it. It will now work - perhaps the Xcode project can now see the framework files or something... not really sure, but it's the only solution that has repeatedly worked for me.

Update

I think this was just a bug with Xcode 9.x, ever since I upgraded to Xcode 10, I haven't had this issue at all. Just import all the frameworks as usual and build and run the project.

Forme answered 13/9, 2018 at 14:17 Comment(1)
I am working with Cordova iOS application, how do I fix for that project which requires this step everytime i run a build.Ephraimite
D
3

Check your "Edit Scheme". My mistake was I set build configuration is release and then build on a simulator.

Devotion answered 29/12, 2021 at 6:41 Comment(2)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewRationale
this resolved my issue. i was running the release build on IOS simulator, after changing it to debug it worked fine.Barrage
T
3
  1. clean build folder and derived data
  2. pod deintegrate
  3. pod install

After those steps issue solved for me.

Transudate answered 6/6, 2022 at 20:50 Comment(0)
A
2

Faced the same problem you can use the below steps which worked for me.

Step 1: Quit Xcode Delete ~/Library/Developer/Xcode/DerivedData and delete the derived data. Then run.

Step 2: If you're getting this error trying to import a dynamic framework, make sure the framework is included in the target's Target Dependencies.

Project > "Target" > Build Phases > Target Dependencies

Amathist answered 20/2, 2019 at 11:26 Comment(0)
R
1

I had the same issue.

It worked for me when I changed

#import <FirebaseAuthInterop/FIRAuthInterop.h>

to

#import "FIRAuthInterop.h"
Roster answered 3/11, 2019 at 16:15 Comment(1)
Where do you even put these imports, if building with flutter?Southernly
A
1

I run into that issue after run pod update

solved issue for me in Podfile:

  pod 'Firebase', '6.9.0'

previously in Podfile was:

  pod 'Firebase'
Athirst answered 10/12, 2020 at 10:36 Comment(4)
Where exactly do you put this piece of code? (Plz be specific in your answers! What's obvious to you is not obvious to someone who's new)Southernly
@KarolinaHagegård in Podfile (this file in the root folder of the project)Athirst
Thank you! 🙂 But plz update the answer to include this information. Comments can be removed at any time, according to StackOverflow. Plus ppl shouldn't have to read first my qn and then your answer in order to get to this info... 😏 We all need to help each other shorten our time spent on trouble shooting! 😊Southernly
After Firebase was optimized for Swift Package Manager the Cocoapods integration seems broken, I used Version 7.11 which also works with CocoapodsMota
A
0

issue from react native ::

try this link

if you didn't get anything from here....it solved my issue

in short: the fix was to add this line below

target 'your app' do in ios/podfile

pod 'FirebaseCore', :modular_headers => true
Appellative answered 19/2, 2023 at 5:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.