【问题标题】:IOS build errors - Xcode 13IOS 构建错误 - Xcode 13
【发布时间】:2023-02-04 14:37:46
【问题描述】:

以下是构建最新 xcode 13 和 Mac Apple Pro M1 芯片时的错误

<unknown>:0: error: module map file '/Users/xxxx/Library/Developer/Xcode/DerivedData/xx-cwbykxafbbbrfjbaeyuaxhdrivdp/Build/Products/Debug-iphonesimulator/Stripe/Stripe.modulemap' not found


<unknown>:0: error: module map file '/Users/xxxx/Library/Developer/Xcode/DerivedData/xx-cwbykxafbbbrfjbaeyuaxhdrivdp/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found
Command PrecompileSwiftBridgingHeader emitted errors but did not return a nonzero exit code to indicate failure

大多数提到编辑 pod 文件和写入排除配置的答案因此尝试了以下修复 -

  installer.aggregate_targets.each do |aggregate_target| 
      aggregate_target.user_project.native_targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)'] # or it won't build on apple silicon
          # without explicitly clearing this out, it flaps between excluding arm64 or not
          
          # Fix some library / linker errors
          config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' # only one at a time
          config.build_settings['VALID_ARCHS'] = 'arm64 x86_64' # you need both to work on both CPU archs / release etc
          config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
        end
      end
      aggregate_target.user_project.save
    end

    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|

        # We support a smaller range of deployment than some libraries, eliminate related noise
        # This also avoids a nasty Folly bug about an API not available until ios10+
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
      end
    end

还提到了几个打开工作区文件的答案,这些文件也尝试过,但这些错误没有解决。请求是否有人可以提供正确的指针。

【问题讨论】:

    标签: ios xcode


    【解决方案1】:

    我在运行 macOS Ventura 的 M1 Mac 中遇到了与 Xcode 14 类似的问题。以下解决方法为我解决了这个问题。

    • 右键单击应用程序 -> Xcode
    • 选择获取信息
    • 选择用罗塞塔打开选项(如果未选中)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-30
      • 2018-11-20
      • 2021-11-21
      • 2018-03-25
      • 1970-01-01
      • 1970-01-01
      • 2019-11-30
      • 1970-01-01
      相关资源
      最近更新 更多