Error: Could not build Objective-C module 'Fir

2019-01-07 08:06发布

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.

13条回答
Rolldiameter
2楼-- · 2019-01-07 08:13

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

On Xcode:

Product->Scheme->FirebaseCore.
查看更多
太酷不给撩
3楼-- · 2019-01-07 08:18

Nothing here worked for me, but then I figured out something that did work.

When I clicked on my project in Project Navigator in Xcode, and then selected Info I looked at the Configurations section and saw that there was only a Release configuration and no Debug configuration for my app.

In order to get Firebase to work, I went to Pods within the Project Navigator, and under the Configurations section I deleted the Debug configuration. Now it builds fine. Hopefully this will help someone else.

查看更多
混吃等死
4楼-- · 2019-01-07 08:20

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.

查看更多
Emotional °昔
5楼-- · 2019-01-07 08:20

I had the exact same issue

You could be reinstalling pods with your Xcode open Or your pods file won't allow and overwrite

With your workspace open, delete the "Pods" folder. Quit X-Code Open terminal in "Utilities" You'll find this in "Applications" Using cd ... go to your project folder reinstall pods using "pod install".

That should fix it.

查看更多
放我归山
6楼-- · 2019-01-07 08:23

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.
查看更多
我想做一个坏孩纸
7楼-- · 2019-01-07 08:23

Build (command + B) works form me

查看更多
登录 后发表回答