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

夙愿已清 提交于 2019-12-02 08:28:53

问题


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.


回答1:


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




回答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




回答3:


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.




回答4:


Try remove the Podfile.lock file and Pods folder.

Run pod install.

This worked for me.




回答5:


I had the same issue.

It worked for me when I changed

#import <FirebaseAuthInterop/FIRAuthInterop.h>

to

#import "FIRAuthInterop.h"



回答6:


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!



来源:https://stackoverflow.com/questions/52077002/header-file-firebasecore-firebasecore-h-not-found-despite-importing-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!