升级xcode7.0 第三方库不能用的解决方法(bitcode是什么鬼?)
2016-03-21 14:36
351 查看
升级完xcode,真机运行发现报错,第三方库错误,微信SDK,高德SDK都报错,如下:
这个问题是由iOS9新特性 bitcode导致的,接下来介绍下这个bitcode,百度来的。
在App Distribution Guide – App Thinning (iOS, watchOS)一节中,找到了下面这样一个定义:
Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new 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 to the 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 bit executables as necessary.
当我们提交程序到App store上时,Xcode会将程序编译为一个中间表现形式(bitcode)。然后App store会再将这个botcode编译为可执行的64位或32位程序。
再看看这两段描述都是放在App Thinning(App瘦身)一节中,可以看出其与包的优化有关了。喵大(@onevcat)在其博客开发者所需要知道的 iOS 9 SDK 新特性中也描述了iOS 9中苹果在App瘦身中所做的一些改进,大家可以转场到那去研读一下。
Bitcode配置
在上面的错误提示中,提到了如何处理我们遇到的问题:
You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
要么让第三方库支持,要么关闭target的bitcode选项。
实际上在Xcode 7中,我们新建一个iOS程序时,bitcode选项默认是设置为YES的。我们可以在”Build Settings”->”Enable Bitcode”选项中看到这个设置。
如果我们开启了bitcode,在提交包时,下面这个界面也会有个bitcode选项:
盗图,我的应用没办法在这个界面显示bitcode,因为依赖于第三方的库,而这个库不支持bitcode,暂时只能设置ENABLE_BITCODE为NO。
所以,如果我们的工程需要支持bitcode,则必要要求所有的引入的第三方库都支持bitcode。我就只能等着公司那些大哥大姐们啥时候提供一个新包给我们了。
参考资料:http://www.cocoachina.com/ios/20150817/13078.html
‘/Users/**/Framework/SDKs/PolymerPay/Library/mobStat/lib**SDK.a(**ForSDK.o)’ does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
这个问题是由iOS9新特性 bitcode导致的,接下来介绍下这个bitcode,百度来的。
在App Distribution Guide – App Thinning (iOS, watchOS)一节中,找到了下面这样一个定义:
Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new 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 to the 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 bit executables as necessary.
当我们提交程序到App store上时,Xcode会将程序编译为一个中间表现形式(bitcode)。然后App store会再将这个botcode编译为可执行的64位或32位程序。
再看看这两段描述都是放在App Thinning(App瘦身)一节中,可以看出其与包的优化有关了。喵大(@onevcat)在其博客开发者所需要知道的 iOS 9 SDK 新特性中也描述了iOS 9中苹果在App瘦身中所做的一些改进,大家可以转场到那去研读一下。
Bitcode配置
在上面的错误提示中,提到了如何处理我们遇到的问题:
You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
要么让第三方库支持,要么关闭target的bitcode选项。
实际上在Xcode 7中,我们新建一个iOS程序时,bitcode选项默认是设置为YES的。我们可以在”Build Settings”->”Enable Bitcode”选项中看到这个设置。
如果我们开启了bitcode,在提交包时,下面这个界面也会有个bitcode选项:
盗图,我的应用没办法在这个界面显示bitcode,因为依赖于第三方的库,而这个库不支持bitcode,暂时只能设置ENABLE_BITCODE为NO。
所以,如果我们的工程需要支持bitcode,则必要要求所有的引入的第三方库都支持bitcode。我就只能等着公司那些大哥大姐们啥时候提供一个新包给我们了。
参考资料:http://www.cocoachina.com/ios/20150817/13078.html
相关文章推荐
- my conclusion about time planing and requirement changes.
- jslint报错太多的解决方式
- 计算机网络之应用层协议
- 自学Android第一步
- Ruby学习笔记2(方法、块、模块)
- 36个常用的代码片段
- DB2查看用户表与指定用户表表结构
- Android中 AsyncTask和Handler对比(特别有用)
- [转] JavaScript 和事件
- Angular路由与Nodejs路由的区别
- 分布式锁 基于Redis
- c/c++工程修改枚举变量惹的祸
- 滚动页面切换logo图片(类似蚂蚁金服)
- android的Animation用法简介
- 前端表单
- android面试(个人)简历
- oracle死锁处理
- oracle 查看表被哪个使用(oracle 查看表被锁)百度
- Gson的详细使用(android必备,快速提高开发效率)
- HttpURLConnection用法详解