Error: Could not build Objective-C module 'Firebase' with Swift 5

浪子不回头ぞ 提交于 2020-08-10 20:13:06

问题


I want to use Firebase with Swift 5, but error message appears.

Could not build Objective-C module 'Firebase'

I tried all resolutions on below pages, but I can't solve it:

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

https://github.com/firebase/quickstart-ios/issues/672

import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

  var window: UIWindow?

  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    FirebaseApp.configure()
    return true
  }
}

I expect Build Success, but actually Build Failed.

Build error messages are:

'FirebaseCore/FirebaseCore.h' file not found Could not build Objective-C module 'Firebase'

And, xcode shows Error message at

import Firebase

in AppDelegate.swift


回答1:


My business partner solves this issue.

The resolution is below steps:

  1. Quite xcode
  2. Delete "ProjectName.xcworkspace", "Podfile.lock" and "Pods".
  3. Delete project's temp files located at ~/Library/Developer/Xcode/DerivedData (Command + Shift + G in finder)
  4. Run "pod install" from terminal.
  5. Open "ProjectName.xcworkspace".
  6. Add "$(inherited)" to "TARGET > Build Settings > Framework Search Paths".


来源:https://stackoverflow.com/questions/57836042/error-could-not-build-objective-c-module-firebase-with-swift-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!