错误:无法使用Swift 5构建Objective-C模块“ Firebase” [英] Error: Could not build Objective-C module 'Firebase' with Swift 5

查看:315
本文介绍了错误:无法使用Swift 5构建Objective-C模块“ Firebase”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Firebase与Swift 5一起使用,但出现错误消息。

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


无法构建Objective-C模块 Firebase

Could not build Objective-C module 'Firebase'

我尝试了以下页面上的所有分辨率,但无法解决:

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

错误:无法构建Objective-C模块 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.

构建错误消息为:


未找到'FirebaseCore / FirebaseCore.h'文件
无法构建Objective-C模块'Firebase'

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

而且,xcode在以下位置显示错误消息

And, xcode shows Error message at

import Firebase

在AppDelegate.swift中

in AppDelegate.swift

推荐答案

我的业务伙伴解决了

解决方法如下:


  1. 相当xcode

  2. 删除 ProjectName.xcworkspace, Podfile.lock和 Pods。

  3. 删除项目的临时文件,该文件位于〜/ Library / Developer / Xcode / DerivedData(查找程序中的Command + Shift + G)

  4. 从终端运行 pod安装。

  5. 打开 ProjectName.xcworkspace。
  6. li>
  7. 添加 $(inhe )转到目标>构建设置>框架搜索路径。

  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".

这篇关于错误:无法使用Swift 5构建Objective-C模块“ Firebase”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆