You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决Unity项目在Xcode14链接时的Bitcode缺失错误?

解决Xcode 14.0.1构建Unity项目时的"does not contain bitcode"错误

报错信息(翻译后)

ld: '/Users/teamviewer/Library/Developer/Xcode/DerivedData/Unity-iPhone-cichdgwogxgtnhchbimudlupdljd/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/Pods_UnityFramework.framework/Pods_UnityFramework(Pods-UnityFramework-dummy.o)' 不包含bitcode。你必须启用bitcode重新构建它(Xcode设置ENABLE_BITCODE),从供应商处获取更新的库,或者为该目标禁用bitcode。文件 '/Users/teamviewer/Library/Developer/Xcode/DerivedData/Unity-iPhone-cichdgwogxgtnhchbimudlupdljd/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/Pods_UnityFramework.framework/Pods_UnityFramework' 属于架构arm64

原因

Apple确实已弃用Bitcode,但Unity 2021.3.11f1导出Xcode项目时,部分配置可能残留Bitcode相关设置,加上Xcode 14对Bitcode的校验比Xcode 13更严格,就触发了这个错误。

解决方法

1. 全局关闭Xcode项目的Bitcode

  • 打开Unity导出的Xcode项目,选中根节点Unity-iPhone
  • 切换到Build Settings标签,搜索ENABLE_BITCODE
  • 把所有目标(包括UnityFramework、Unity-iPhone,还有Pods下的所有子目标)的Enable Bitcode都改成NO

2. 通过Podfile强制禁用Bitcode

如果上面的操作没解决,就在Podfile里加一段配置,确保所有Pod都关闭Bitcode:

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

加完之后执行pod install重新安装依赖。

3. 检查Unity导出前的配置

  • 打开Unity编辑器,进入Player Settings → iOS → Other Settings
  • 确认Enable Bitcode选项已经设为Off(2021.3.x版本默认可能是Off,但最好手动核对)
  • 重新导出Xcode项目再构建

内容的提问来源于stack exchange,提问作者ohthepain

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 04:15:39