Introduction and configuration of Bitcode in iOS

Source: Internet
Author: User

Run the project on the real Machine (IOS 8.3) with Xcode 7 Beta 3 and find that the project compiles. The following error has been reported:

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 a updated library from the vendor, or DISA Blebitcode for this target. For Architecture arm64

The information obtained is the introduction of a third-party library that does not contain bitcode.

What the hell is a bitcode?

Check out the official documentation in the app

Distribution Guide–app thinning (IOS, WatchOS) section, the following definition is found:

Bitcode is an intermediate representationof a compiled program. Apps upload to ITunes Connect that contain Bitcodewill is compiled and linked on the App Store. Including Bitcode would allowapple to re-optimize your app binary on the future without the need to submit anew version of Your app to the store.

The Bitcode is an intermediate form of code that is compiled by the program. Programs that contain Bitcode configuration will be compiled and linked on the App store. Bitcode allows Apple to re-optimize the binary files of the program at a later stage without having to resubmit a new version to the App Store.

In the What's New in Xcode-new Features in Xcode 7, there is a description of the following:

Bitcode. When your archive for submission tothe app Store, Xcode'll compile your app into an intermediate representation. The App Store would then compile the bitcode to the the or bitexecutables as necessary.

When the program is submitted to the App Store, Xcode compiles the program into an intermediate representation (Bitcode). The App Store then compiles the botcode into an executable 64-bit or 32-bit program.

Look at these two descriptions, all in the app thinning (app slimming) section, you can see that it is related to the optimization of the package.

Bitcode Configuration

In the above error message, we mentioned how to handle the problem we encountered:

You must rebuild it with Bitcode enabled (Xcode setting Enable_bitcode), obtain a updated library from the vendor, Ordisab Le Bitcode for this target. For Architecture arm64

Either let the third-party library support or turn off the target's bitcode option.

In fact, in Xcode 7, when we create a new iOS program, the Bitcode option is set to Yes by default. We can see this setting in the "Build Settings", "Enable bitcode" option. However, what we need to consider now is three platforms: Ios,mac Os,watchos.

For Ios,bitcode is optional, for Watchos,bitcode is required, and Mac OS is not supported for Bitcode.

If we open the Bitcode, the following interface will also have a bitcode option when submitting the package:

Therefore, if our project needs to support Bitcode, it is necessary to require all third-party libraries that are introduced to support Bitcode.

Through this article on the concept of Bitcode and configuration of the brief introduction, I hope that iOS developers in the project run a similar situation, can be more effective according to the above introduction to find the cause and timely processing.

Original address: Http://www.jianshu.com/p/3e1b4e2d06c6

Introduction and configuration of Bitcode in iOS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.