小知识iOS学习笔记iOS开发

关于Bitcode

2016-03-24  本文已影响165人  余荣景

Bitcode是被编译程序的一种中间形式的代码。包含bitcode配置的程序将会在AppStore上被编译和链接。允许苹果在后期重新优化程序的二进制文件,而不需要重新提交一个新的版本到AppStore。

而在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.

当提交程序到App store上时,Xcode会将程序编译为一个中间表现形式(bitcode)。然后App store会再将这个botcode编译为可执行的64位或32位程序。
再看看这两段描述,都是放在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

要么让第三方库支持,要么关闭target的bitcode选项。

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

所以,如果我们的工程需要支持bitcode,则必要要求所有引入的第三方库都支持bitcode。

上一篇 下一篇

猜你喜欢

热点阅读