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.
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.
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
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.
Try remove the Podfile.lock
file and Pods
folder.
Run pod install
.
This worked for me.
来源:https://stackoverflow.com/questions/52077002/header-file-firebasecore-firebasecore-h-not-found-despite-importing-firebase