首页 > 技术文章 > iOS:*** 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. for architectu

UncleDraw 2016-07-08 16:38 原文

  Xcode7 报错 *** 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. for architecture armv7。

  解决项目中导入的静态库不支持bitcode,然而Xcode默认支持bitcode。当Xcode支持bitcode时,所有的framwork和二进制库都要包含bitcode。所以可以将bitcode设置为NO,如下图所示:

                      

 

Bitcode (iOS, watchOS)

Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.

Xcode hides symbols generated during build time by default, so they are not readable by Apple. Only if you choose to include symbols when uploading your app to iTunes Connect would the symbols be sent to Apple. You must include symbols to receive crash reports from Apple.

Note: For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS apps, bitcode is required.  

官方文档: https://developer.apple.com/library/prerelease/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html#//apple_ref/doc/uid/TP40012582-CH35

Bitcode 是编译的应用程序的中间一种形式.你提交到AppStore上的应用程序包含的bitcode会在AppStore上被编译和链接.在未来包含bitcode的应用程序,会让Apple重新优化你的二进制文件而不需要重新提交新的版本.意思就是加入苹果会更换硬件架构(CPU之类的).开发者也不需要再根据不同的平台开发新的软件.

注意: iOS APP,bitcode是默认的.但是不是必须的.但是你如果支持bitcode的话,那么应用中的的app和frameworks都必须包含bitcode.对watchOS app来说,bitcode是必须的.总的来说,bitcode是一种介于LLVM编译器和编程语言的一种中间态.虽然bitcode不能在任何平台上运行,但是它可以转换成任何所支持的CPU架构.

 

推荐阅读