Error: Could not build Objective-C module 'Firebase'

When I compile the application I get an error equal to this:

Could not build Objective-C module 'Firebase'

This error appear in import Firebase of my file swift.


Solution 1:

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.

Solution 2:

Build ( + B) worked for me.

Solution 3:

I am using Swift 4 and Xcode 9. All I have to do is selecting FirebaseCore Scheme.

On Xcode:

Product->Scheme->FirebaseCore.

If you don't have FirebaseCore go to Manage Schemes and select it. Then try again.

Solution 4:

This may fix your problem:

  1. Quit the Xcode. (Don't just close the Xcode window, right click and Quit it explicitly).

  2. Go to ~/Library/Developer/Xcode/DerivedData and delete the project folder. (Simply delete all the folders).

  3. Clean and Build the project.

If still error exist:

Do steps 1 and 2 and follow this steps:

  1. Change scheme to Firebase and Build (Command + B).

  2. Change back to your app scheme and Run again.