Xcode 13.3 归档报错问题解决

2022-03-24  本文已影响0人  edison0951

最近升级到 Xcode 13.3 之后,归档的时候报以下错误:
错误1:

remark: Incremental compilation has been disabled: it is not compatible with whole module optimization

错误2:

error: Abort trap: 6 (in target 'SKPhotoBrowser' from project 'Pods')

在未升级到 Xcode13.3 之前一切正常,Pods.project 的 Enable Bitcode 设置为 NO, 但是升级到最新的 Xcode13.3 后,只要 archive ,就会报上面的错误。查看了一下各个第三方库的 target ,Enable Bitcode 均为 YES。有可能是 Xcode13.3 修改了校验规则,因此需要在 Podfile 里面加上自动化处理方法,将所有 pod target 的 Enable Bitcode 设置为NO.

  post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['ENABLE_BITCODE'] = 'NO'
        end
      end
    end

将以上代码添加到 Podfile 后,重新执行pod install, 并 clean project, 清除掉 DerivedData的缓存,重新编译就好了。

上一篇 下一篇

猜你喜欢

热点阅读