Could not build Objective-C module 'Firebase&#

2019-08-02 01:21发布

I am getting this error for import Firebase:

Could not build Objective-C module 'Firebase'

Xcode also complains about FirebaseAnalytics saying

'FirebaseAnalytics/FirebaseAnalytics.h' file not found.

My project used to build just fine until I updated to swift 4.

I am using the latest version of Firebase via Cocoapods version 1.4.0 beta 2.

4条回答
对你真心纯属浪费
2楼-- · 2019-08-02 01:58

I just had the same issue. What I had to do was:

  • Close Xcode
  • Restart Xcode and made sure I opened the .xcworkspace project file.
  • Ran a Build on the project.

After that I had no more Firebase error messages.

查看更多
Animai°情兽
3楼-- · 2019-08-02 02:01

In Xcode, Go to Product -> Scheme -> Select New Scheme. Then choose FirebaseCore as Target and Name. Now build the project and then change back to your app target. It works for me in Xcode 9.1

查看更多
Fickle 薄情
4楼-- · 2019-08-02 02:03

After updating to XCode 9.4 the problem resolved itself.

查看更多
劳资没心,怎么记你
5楼-- · 2019-08-02 02:05

Link Binary with Libraries

Build Phases - under Link Binary With Libraries - this is where the magic happens:

enter image description here

It is very likely, your binary is not linked with the Firebase library - hence the header file cannot be found.

查看更多
登录 后发表回答