Xcode更新到14版本后编译后报错:
'xxx' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE),obtain an updated library from the vendor,or disable bitcode for this target. file 'xxx' for architecture arm64
这是由于在Xcode14中放弃了bitcode,iOS 9、iOS 10,最小支持iOS 11,并不再支持构建 armv7、armv7s 以及 i386 架构的 iOS 项目,而以前的Xcode 是默认使用 armv7 和 arm64架构。
去掉了armv7的优势是可以降低ipa包的大小
直接上解决方案:推荐优先使用方法二
方法一:
首先关闭原项目中的ENABLE_BITCODE设为No。target --> Built Seeting -->搜索 ENABLE_BITCODE --->将Yes置为No
由于Xcode14不再支持iOS11以下的版本所以需要将build_settings中的IPHONEOS_DEPLOYMENT_TARGET设置为11.0
推荐使用方案在Podfile中设置,如下所示:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
end
最后重新Pod install
注意 Target中的 Build settings--> iOS Deployment Target 也得设置iOS11.0
另外还有Pod工程中的Bundle target签名报错,只要选择一下Bundle target 签名中的Team,与主工程一致即可,或者在Podfile中使用
config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"
进行设置。
方法二:
如果上述方案还是报此错误使用如下方案:
什么都不用改(也不需要限制iOS11以上),只需要保证签名一致即可
在Podfile中设置,如下所示:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
end
然后 Pod install 即可
原文地址:https://blog.csdn.net/qq_37269542
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。