Could not build Objective-C module 'Firebase'

Hi Everyone,

Can someone help me out with this?

When I compile the application I get an error equal to this: Could not build Objective-C module 'Firebase'

This error appears in "Import Firebase" of my file "ViewController.swift".

Accepted Answer

There is only one way to solve this issue.

  1. Quit Xcode.
  2. Delete project's temp files located at ~/Library/Developer/Xcode/DerivedData
  3. Delete ProjectName.xcworkspace
  4. Delete Podfile.lock file and Pods folder
  5. Run pod install.
  6. Open the newly created ProjectName.xcworkspace file and build.
  • Thanks a lot. Working for me after following the ⬆️ steps.

  • I'm not using Pod, I am using carthage. However, I am using workspace. Because some frameworks were throwing errors like 'Cannot compile framework compiled with 5.1.3 on 5.2.3 compiler'. :.. Anyone know what could be the issue? I've checked if the header is listed in the public section and it is.

Add a Comment

Answers

There is only one way to solve this issue.

  1. Quit Xcode.
  2. Delete project's temp files located at ~/Library/Developer/Xcode/DerivedData
  3. Delete ProjectName.xcworkspace
  4. Delete Podfile.lock file and Pods folder
  5. Run pod install.
  6. Open the newly created ProjectName.xcworkspace file and build.
  • Thanks a lot. Working for me after following the ⬆️ steps.

  • I'm not using Pod, I am using carthage. However, I am using workspace. Because some frameworks were throwing errors like 'Cannot compile framework compiled with 5.1.3 on 5.2.3 compiler'. :.. Anyone know what could be the issue? I've checked if the header is listed in the public section and it is.

Add a Comment
This solution works great!
Thank you so much!
Why does this happen? It's so annoying having to completely re-integrate cocoapods all the time
Saved my day, Thanks ...
People are missing this step here "This creates an .xcworkspace file for your app. Use this file for all future development on your application"

Stop using the workspace that you originally created. Close your editor, and open the one that its created after you run pod install. No need to do anything else
  • Thank you so much, I didn't have to delete anything. I did exactly what you said and it worked!

Add a Comment

I was opening .xcodeproj instead of .xcworkspace