iOS中Bitcode的报错

来源:互联网 发布:中行信用卡 知乎 编辑:程序博客网 时间:2024/06/04 17:47

         昨天晚上升级了Mac系统到10.10.5Xcode也到了7.0,手机也升级到了iOS9.不过今天早上发现,升级以后,运行的时候,报错:UMengFeedback_SDK_2.1/libUMFeedback.a(UMChatTableViewCell.o)'doesnot contain bitcode. You must rebuild it with bitcode enabled (XcodesettingENABLE_BITCODE), obtain an updated library from the vendor, or disablebitcodefor this target. for architecture arm64,顿感郁闷至极。

后来看了下文档,理解如下:

一、Bitcode是什么呢?

其实,说白了,Bitcode就是苹果编译后的代码的一种中间形式。如果程序中Bitcode的开关是打开的,那么 该程序将会在App store上被编译和链接。当苹果拿到用户上传的bitcode程序包以后,可以自己处理转换成32位以及64位。

Xcode 7中,有一段描述如下:

Bitcode. When you archive for submission tothe App Store, Xcode will compile your app into an intermediaterepresentation.The App Store will then compile the bitcode down into the 64or32 bite xecutables as necessary.

当提交程序到App store上时,Xcode会将程序编译为一个中间表现形式(Bitcode)。然后App store会再将这个Bitcode编译为可执行的64位或32位程序。

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

 

二、解决办法:

解决办法一、让第三方库支持Bitcode

解决办法二、关闭targetBitcode选项。

实际上,在Xcode 7中,我们新建一个iOS程序时,Bitcode选项默认是设置为YES的。我们可以在”BuildSettings”->”Enable Bitcode”选项中看到这个设置。不过,我们现在需要考虑的是三个平台:iOSMac OSwatchOS

对于iOSBitcode是可选的;对于watchOSBitcode是必须的;而Mac OS是不支持Bitcode

如果我们开启了Bitcode,在提交程序到AppStore时,会看到有Bitcode的选项:

1 0
原创粉丝点击