错误:无法使用Swift 5构建Objective

编程入门 行业动态 更新时间:2024-10-16 22:18:29
本文介绍了错误:无法使用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/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

推荐答案

我的业务伙伴解决了

解决方法如下:

  • 相当xcode
  • 删除 ProjectName.xcworkspace, Podfile.lock和 Pods。
  • 删除项目的临时文件,该文件位于〜/ Library / Developer / Xcode / DerivedData(查找程序中的Command + Shift + G)
  • 从终端运行 pod安装。
  • 打开 ProjectName.xcworkspace。
  • li>
  • 添加 $(inhe )转到目标>构建设置>框架搜索路径。
  • Quite xcode
  • Delete "ProjectName.xcworkspace", "Podfile.lock" and "Pods".
  • Delete project's temp files located at ~/Library/Developer/Xcode/DerivedData (Command + Shift + G in finder)
  • Run "pod install" from terminal.
  • Open "ProjectName.xcworkspace".
  • Add "$(inherited)" to "TARGET > Build Settings > Framework Search Paths".
  • 更多推荐

    错误:无法使用Swift 5构建Objective

    本文发布于:2023-11-26 02:38:13,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1632308.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:错误   Swift   Objective

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!