告诉你 IOS7.0 之后的Bitcode到底是什么!!

用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 (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

得到的信息是引入的一个第三方库不包含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瘦身)一节中,可以看出其与包的优化有关了。

Bitcode配置

在上面的错误提示中,提到了如何处理我们遇到的问题:
You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE www.maiziedu.com), 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”选项中看到这个设置。不过,我们现在需要考虑的是三个平台:iOS,Mac OS,watchOS。
对于iOS,bitcode是可选的;对于watchOS,bitcode是必须的;而Mac OS是不支持bitcode。

所以,如果我们的工程需要支持bitcode,则必要要求所有引入的第三方库都支持bitcode。
   
        通过本文对bitcode的概念及配置情况的简要介绍,希望iOS开发人员在工程运行中遇到类似的情况,可以根据上文的介绍更有效的找到原因并及时处理。

时间: 2024-08-11 09:49:50

告诉你 IOS7.0 之后的Bitcode到底是什么!!的相关文章

IOS7.0 UILabel实现自适应高度的新方法

//IOS7.0中利用- (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(NSDictionary *)attributes context:(NSStringDrawingContext *)context 方法可以获取label的Size大小,来自适应高度,取代了之前的- (CGSize)sizeWithFont:(UIFont *)font const

ios7.0结合storyborad实现页面跳转的总结

折腾了一整天,本文总结一下ios7.0页面跳转有关的内容 storyboard的潜规则 我接触ios很晚,环境已经是xcode5+ios7,所以对以前的IOS开发模式并不了解.在网上查阅了很多资料,发现以前的代码,很多都需要自己coding来创建ViewController,比如: Objc代码   WTwoViewController *controller = [[WTwoViewController alloc]initWithNibName:@"WTwoViewController&qu

iOS开发之iOS6.0\iOS7.0\iOS8.0的UIAlertView message 文字对齐设置

是不是发现原来这段代码: #pragma mark - #pragma mark - alert delegate - (void) willPresentAlertView:(UIAlertView *)alertView { for (UIView *subViewin alertView.subviews) { UILabel *tmpLabel = (UILabel *)subView; tmpLabel.textAlignment =NSTextAlignmentLeft; } } 在

解决 ios7.0 以后自定义导航栏左边按钮靠右的问题

解决 ios7.0 以后自定义导航栏左边按钮靠右的问题 www.111cn.net 编辑:edit02_lz 来源:转载 最近开发了一个ios的app,在ios7.0+出现自定义导航栏左边按钮出现靠右的情况,后来自己解决了,解决办法如下 1.自定义按钮  代码如下 复制代码 //左按钮UIButton *leftBtn = [[UIButton alloc]initWithFrame:RectWithPara(-20, 0, 44, 44)];[leftBtn addTarget:self ac

App Icon and Launch Images for iOS7.0 or Later

App Icon and Launch Images for iOS7.0 or Later 1.App Icon File Name File Size(px) Used For [email protected] 58 x 58 Spotlight and Settings on devices with retina display [email protected] 87 x 87 Settings on iPhone 6 Plus [email protected] 80 x 80 S

0.1+0.2=?在前端里,告诉你:≠0.3 !

今天,我来算一道"小学"数学题:0.1+0.2=? 按正常的数学逻辑来计算的话,0.1+0.2当然=0.3啦!但是,咱们也都不是什么小孩子了,都走上了各行各业,那么前端程序员要告诉你一个事!0.1+0.2≠0.3(手动滑稽) 咱们写一段JS代码吧: var a,b,sum; a=0.1; b=0.2; sum=a+b; 执行结果: WTF??? 0.30000000000000004是个什么鬼?但这就是计算机给你正确的答案: 好吧,我来说说为什么会出现这样的结果: 首先声明这不是bug

iOS7.0中UILabel高度调整注意事项

转自:http://blog.csdn.net/k12104/article/details/33731833 http://herkuang.info/blog/2013/12/31/ios7%E4%B8%ADuilabel%E9%AB%98%E5%BA%A6%E8%B0%83%E6%95%B4%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/ 我的“记词助手”在升级到iOS7之后,一直出现UILabel错位的问题: 我的label是用- (CGSize)sizeWit

解决ios7.0 以后自己定义导航栏左边button靠右的问题

1.自己定义button //左button UIButton *leftBtn = [[UIButton alloc]initWithFrame:RectWithPara(-20, 0, 44, 44)]; [leftBtn addTarget:self action:@selector(btnClicked:) forControlEvents:UIControlEventTouchUpInside];//设置button点击事件 [leftBtn setBackgroundImage:Im

解决ios7.0 以后自定义导航栏左边按钮靠右的问题

1.自定义按钮 //左按钮 UIButton *leftBtn = [[UIButton alloc]initWithFrame:RectWithPara(-20, 0, 44, 44)]; [leftBtn addTarget:self action:@selector(btnClicked:) forControlEvents:UIControlEventTouchUpInside];//设置按钮点击事件 [leftBtn setBackgroundImage:ImageNamed(@"ic