iOS Bitcode的介绍及解决

iOS 9.0更新碰到:第三方库不包含bitcode - Yuan_ios - 616499035的博客

打开Xcode ,运行错误提示 某一个第三方库不包含bitcode?  bitcode?是什么,以前没有注意过。

查阅了一下官方文档,在App

Distribution Guide–App Thinning (iOS, watchOS)一节中,找到了下面这样一个定义:

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

Bitcode是一个中级representationof编译程序。应用程序上传iTunes Connect包含bitcodewill编译和链接在App Store。包括bitcode将来allowApple优化你的应用程序二进制而不需要重新提交版本的应用程序商店。

而在What’s New in Xcode-New Features in Xcode 7中,还有一段如下的描述:

Bitcode. When you archive for submission tothe App Store, Xcode will compile your app into an intermediate representation.The App Store will then compile the bitcode down into the 64 or 32 bitexecutables as necessary.

Bitcode。当你档案提交到应用程序商店,Xcode将编译你的应用程序到一个中间表示。App Store将编译bitcode分成64或32 bitexecutables是必要的。

再看看这两段描述,都是放在App Thinning(App瘦身)一节中,可以看出其与包的优化有关了。

Bitcode配置

在上面的错误提示中,提到了如何处理我们遇到的问题:

You must rebuild it with bitcode enabled(Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, ordisable bitcode for this target. for architecture arm64

你必须重建它启用了bitcode(Xcode设置ENABLE_BITCODE),从供应商获得一个更新的库,ordisable bitcode这个目标。建筑arm64

现在有两种解决方式:

1.让第三方库支持bitCode,

2.关闭target的bitcode选项。我现在所使用的方法就是将bitcode关闭

在Xcode 7以后,我们新建一个iOS程序时,bitcode选项默认是设置为YES的。我们可以在”Build Settings”->”Enable Bitcode”选项中看到这个设置

iOS 9.0更新碰到:第三方库不包含bitcode - Yuan_ios - 616499035的博客

将Enable Bitcode默认的YES 选项改成NO 就行了
希望对遇到类似问题朋友有所帮助
希望朋友们提出更好的解决办法 
原文地址:https://www.cnblogs.com/Lovexiaohuzi/p/8057535.html