简体   繁体   English

IOS 构建错误 - Xcode 13

[英]IOS build errors - Xcode 13

Below are errors while building in latest xcode 13 & Mac Apple Pro M1 chip以下是构建最新 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

Most of the answers mentioned to edit pod file & write exclude configuration hence the tried below fix -大多数关于编辑 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

Also couple of answers mentioned to open workspace file which also tried but these errors are not resolving.还提到了几个打开工作区文件的答案,这些文件也尝试过,但这些错误没有解决。 Requesting if someone can provide right pointers.请求是否有人可以提供正确的指针。

I faced a similar issue with Xcode 14 in M1 Mac running macOS Ventura.我在运行 macOS Ventura 的 M1 Mac 中遇到了与 Xcode 14 类似的问题。 The following workaround fixed the issue for me.以下解决方法为我解决了这个问题。

  • Right click on Applications -> Xcode右键单击应用程序 -> Xcode
  • Choose Get Info选择获取信息
  • Select Open with Rosetta option if it's not selected Select Open with Rosetta option 如果没有选择

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM