【问题标题】:Transfer to Apple M1 Xcode shows an error "'FirebaseCore/FirebaseCore.h' file not found" and "Could not build Objective-C module 'Firebase'"传输到 Apple M1 Xcode 显示错误“找不到‘FirebaseCore/FirebaseCore.h’文件”和“无法构建 Objective-C 模块‘Firebase’”
【发布时间】:2021-12-24 22:34:14
【问题描述】:

在我的 Xcode 项目中有一个相当普遍的问题。我正在使用 Firebase,项目在 Intel i5 上与 Xcode 11 完美配合,但在 Apple M1 上使用 Xcode 13 (Swift 5) 时出现 2 个严重错误:

  • 找不到“FirebaseCore/FirebaseCore.h”文件

  • 无法构建 Objective-C 模块 'Firebase'

我的豆荚:

所以,我尝试了什么:

  1. 相当的xcode 删除“ProjectName.xcworkspace”、“Podfile.lock”和“Pods”。 删除位于 ~/Library/Developer/Xcode/DerivedData 的项目临时文件(查找器中的 Command + Shift + G) 从终端运行“pod install”。 打开“ProjectName.xcworkspace”。

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

  1. 为主项目和 Pods 项目添加 arm64Excluded Architectures

Xcode 12: build Error on FIRAnalyticsConnector

还有许多其他选择。但是没有一个适合我。我应该尝试什么?

【问题讨论】:

  • 试试pod deintegratepod update
  • @PaulBeusterien thanx,但不起作用。你怎么看,有没有可能是因为我在新的 macbook M1 上使用了迁移助手而存在这个问题?

标签: ios firebase swift5 apple-m1 xcode13


【解决方案1】:
  1. $ pod deintegrate
  2. $ pod clean
  3. 使用 Rosetta 打开终端
  4. $ pod 安装

【讨论】:

    【解决方案2】:

    我的朋友试过这个。将此添加到 podfile 的末尾并重新安装 cocoapods。花了我和团队几个小时,但我们最终想通了。

    post_install do |installer|
      installer.pods_project.build_configurations.each do |config|
        config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
      end
    end
    

    【讨论】:

    • thanx,请告诉我如何正确地用 M1 重新安装 cocoapods?
    • @StanislavPutilov 有很多方法可以做到这一点,我的做法是: 1. 删除 .workspace 文件。 2. 删除 Pods 文件夹。 3. 删除 podfile.lock 并运行 pod install
    猜你喜欢
    • 2019-07-13
    • 1970-01-01
    • 2021-09-13
    • 1970-01-01
    • 2020-10-09
    • 1970-01-01
    • 2017-06-02
    • 2022-11-03
    相关资源
    最近更新 更多