PhoneGap中文网

标题: xcode7.1 ios9.0以后极光推送以及第三方插件没法使用解决bitcode [打印本页]

作者: admin    时间: 2015-11-20 11:29
标题: xcode7.1 ios9.0以后极光推送以及第三方插件没法使用解决bitcode
随着 Xcode7的面世,我们都清楚的知道,他可以不通过https://developer.apple.com中的测试证书就可以真机测试了,对于我们开发者来说这是一个很好地事情,但是也会出现一些问题。

我们在做项目的时候,或多或少的会用的到第三方类库,那么问题来了,当你用 xcode在真机(iOS 8.3)上运行一下工程,结果发现工程编译不过。看了下问题,报的是以下错误:
ld: ‘/Users/**/Framework/SDKs/PolymerPay/Library/mobStat/lib**SDK.a(**ForSDK.o)’does not contain bitcode. You must rebuild it with bitcode enabled (Xcodesetting ENABLE_BITCODE), obtain an updated library from the vendor, or disablebitcode for this target. for architecture arm64
看警告可以得到的信息是"引入的一个第三方库不包含bitcode"。 嗯? bitcode 是神马东西呢?




好吧 我们去查询一下API 吧,终于找到了
在 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是被编译程序的一种中间形式的代码。包含bitcode配置的程序将会在App store上被编译和链接。bitcode允许苹果在后期重新优化程序的二进制文件,而不需要重新提交一个新的版本到App store上。

还有在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位程序。
可到这里,我还是不太明白是神马意思,通过查阅相关资料,得出的结论是 这个东西应该和包得优化有关。

出现问题,我们要想办法解决它


在上面的错误提示中,提到了如何处理我们遇到的问题:
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 要不你就关掉它

好吧,我们只能选择后者了
我们来看看他在那里?
新建一个工程,我们可以在”Build Settings”->”Enable Bitcode”选项中看到这个设置。当然我这里是改过的,其实新建的 xcode 工程 bitcode 是默认打开的!



好了改成 NO 就可以真机测试了!要是打包没有改为 NO 的话.再上传包的时候是可以看到这个选项的,截图我就不发了。






作者: ionicwang    时间: 2015-12-20 12:39
谢谢分享了我的也是报这个错误,这样解决的







欢迎光临 PhoneGap中文网 (http://bbs.phonegap100.com/) Powered by Discuz! X3.2