swiftydev
swiftydev

Reputation: 57

Could not build Objective-C module 'Firebase'

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.

Upvotes: 2

Views: 16795

Answers (4)

LowDownDirtyShame
LowDownDirtyShame

Reputation: 169

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.

Upvotes: 16

Vinoth
Vinoth

Reputation: 9764

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

Upvotes: 4

swiftydev
swiftydev

Reputation: 57

After updating to XCode 9.4 the problem resolved itself.

Upvotes: 1

Mick
Mick

Reputation: 31959

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.

Upvotes: 1

Related Questions