bitcode?
今天在网站上看到一篇关于第三方库不包含bitcode就会报错的文章,感觉剖析得很详细,分享出来,希望可以对iOS初入门者有所帮助。下面我们就一起来看看吧。
用Xcode 7 beta 3在真机(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是个什么鬼?
查阅了一下官方文档,在App
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位程序。
再看看这两段描述,都是放在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”选项中看到这个设置。不过,我们现在需要考虑的是三个平台:iOS,Mac OS,watchOS。
对于iOS,bitcode是可选的;对于watchOS,bitcode是必须的;而Mac OS是不支持bitcode。
如果我们开启了bitcode,在提交包时,下面这个界面也会有个bitcode选项:

所以,如果我们的工程需要支持bitcode,则必要要求所有引入的第三方库都支持bitcode。
通过本文对bitcode的概念及配置情况的简要介绍,希望iOS开发人员在工程运行中遇到类似的情况,可以根据上文的介绍更有效的找到原因并及时处理。
二度转载....
bitcode?的更多相关文章
- iOS静态库开发中对Bitcode的支持
1.bitcode bitcode是LLVM编译器将C/C++/OC/Swift等前端变成语言编译成多种不同芯片上的机器指令过程中的中间代码.并且这个中间代码是CPU无关的. 原本我们的APP里要包含 ...
- 环信SDK报错处理方法obtain an updated library from the vendor, or disable bitcode for this target. for archit
ld: '/Users/momo/Desktop/ThreeFingers/Pods/EaseMobSDKFull/EaseMobSDKFull/lib/libEaseMobClientSDK_arm ...
- [OC] 理解Bitcode:一种中间代码
Tip:参考资料 理解Bitcode:一种中间代码 (内容从该博客摘录的.本随笔摘录些简要内容.) App Distribution Guide – App Thinning (iOS, watchO ...
- Xcode7 *** does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE)
*** does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE ...
- iOS - Bitcode App 瘦身中间码
1.Bitcode 随着 Xcode7 的发布,Apple 提供了一项新的技术来支持 App 瘦身功能,那就是 Bitcode. 1.BitCode 是什么 Bitcode is an interme ...
- 深入理解iOS开发中的BitCode功能
前言 做iOS开发的朋友们都知道,目前最新的Xcode7,新建项目默认就打开了bitcode设置.而且大部分开发者都被这个突如其来的bitcode功能给坑过导致项目编译失败,而这些因为bitcode而 ...
- Xcode 7.0升级后的bitcode
iOS 9.0中加入了一个新的功能,bitcode, 使用bitcode优化的app,体积可以变得更小. Apple可以在提交app后,向9.0及以上版本用户提供优化的小体积版本,向其他用户提供常规版 ...
- (转) Xcode 7 Bitcode
Xcode 7 Bitcode的工作流程及安全性评估 2015-12-18 06:13 编辑: suiling 分类:iOS开发 来源:FreeBuf黑客与极客 简介 随着 Xcode 7 的发布,苹 ...
- iOS之 Xcode7下 bitcode的工作流程及安全评估
文章参考来自http://www.freebuf.com/articles/others-articles/89806.html 很多朋友在升级Xcode7以后原有正常运行的工程在Xcode7下编译会 ...
- 升级xcode7.0 第三方库不能用的解决方法(bitcode是什么鬼?)
升级完xcode,真机运行发现报错,第三方库错误,微信SDK,高德SDK都报错,如下: ‘/Users/**/Framework/SDKs/PolymerPay/Library/mobStat/lib ...
随机推荐
- css-实现子元素垂直居中
1.父元素:position:relative; 2.子元素:position:absolute; top:50%; transform:translate(0,-50%); 完美解决
- js 编写一个神奇的四则运算
写一个算法,有时候可以用简单的方法就可以写出来,但是只能针对特定的环境,如果要能够适应不同的环境,就需要对算法进行优化,在优化的过程中,你会觉得非常神奇,下面来看一个简单的四则运算的算法编写方式: 1 ...
- codes often WA
枚举: 1.完美立方 #include<iostream> #include <cstdio> using namespace std; int main() { int N; ...
- 通过给事件处理程序传递this参数,获取事件源对象的引用。单机提交按钮时在信息框中显示用户输入的字符。
<script> function mymethod(str) { alert("您输入的是:"+str); } </script><form act ...
- Python模块和类.md
模块的定义 代码的层次结构 对于python的层次结构一般为包->模块 包也就是文件夹,但是文件夹下必须有文件"init.py"那么此文件夹才可以被识别为包."in ...
- C# 图像处理:复制屏幕到内存中,拷屏操作
/// <summary> /// 复制屏幕到内存中 /// </summary> /// <returns>返回内存流</returns> publi ...
- 吴裕雄 python神经网络 水果图片识别(3)
import osimport kerasimport timeimport numpy as npimport tensorflow as tffrom random import shufflef ...
- JAVA集合操作异常 ---------Collections.unmodifiableCollection
1.问题原因 这两天在做开发的时候,在一个首页的列表哪里操作了ArrayList集合,在做递归删除的时候用的是Iterator对象(至于为什么用,来个链接https://blog.csdn.net/m ...
- Layout两列定宽中间自适应三列布局
最容易理解的一种方法,以中间内容为主体,通过 margin 或者 padding 将两侧撑开,最后用 absolute 定位两侧 html: <div class="container ...
- html -引入其他html页面
其他页面html为:ip.html 主页面代码 <body> <div id="ip"></div> </body> <scr ...