您的位置:首页 > 其它

为什么Enable BitCode(Xcode7)真机测试要修改为 NO

2016-04-30 18:35 330 查看
随着 Xcode7的面世,我们都清楚的知道,他可以不通过https://developer.apple.com中的测试证书就可以真机测试了,对于我们开发者来说这是一个很好地事情,但是也会出现一些问题。
我们在做项目的时候,或多或少的会用的到第三方类库,那么问题来了,当你用
xcode在真机(iOS 8.3)上运行一下工程,结果发现工程编译不过。看了下问题,报的是以下错误:
ld:‘/Users/**/Framework/SDKs/PolymerPay/Library/mobStat/lib**SDK.a(**ForSDK.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是神马东西呢?
好吧我们去查询一下API吧,终于找到了
在Distribution Guide–App Thinning (iOS, watchOS)一节中,找到了:
Bitcode is an intermediate representationof a compiledprogram. Apps you upload to iTunes Connect that contain bitcodewill be compiledand linked on the
App Store. Including bitcode will allowApple to re-optimizeyour app binary in the future without the need to submit anew version of yourapp to the store.
说的是bitcode是被编译程序的一种中间形式的代码。包含bitcode配置的程序将会在App
store上被编译和链接。bitcode允许苹果在后期重新优化程序的二进制文件,而不需要重新提交一个新的版本到App store上。
还有在What’sNew 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 Storewill then compile
the bitcode down into the 64 or 32 bitexecutables asnecessary.
当提交程序到App store上时,Xcode会将程序编译为一个中间表现形式(bitcode)。然后App
store会再将这个botcode编译为可执行的64位或32位程序。
可到这里,我还是不太明白是神马意思,通过查阅相关资料,得出的结论是这个东西应该和包得优化有关。
出现问题,我们要想办法解决它
在上面的错误提示中,提到了如何处理我们遇到的问题:
You must rebuild it with bitcode enabled(Xcode settingENABLE_BITCODE), obtain an updated library from the vendor, ordisable bitcodefor this target.
for architecture arm64
意思就是说:要不你第三方类库支持 bitcode要不你就关掉它
好吧,我们只能选择后者了
我们来看看他在那里?
新建一个工程,我们可以在”Build Settings”->”EnableBitcode”选项中看到这个设置。当然我这里是改过的,其实新建的
xcode 工程 bitcode是默认打开的!
好了改成 NO就可以真机测试了!要是打包没有改为
NO的话.再上传包的时候是可以看到这个选项的,截图我就不发了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: