Original URL: http://www.cocoachina.com/ios/20150818/13078.html
Try running our project on a real machine (IOS 8.3) with Xcode 7 Beta 3 today, and found that the project was compiled. The following error has been reported:
1 |
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 |
The information we get is a third-party library that we introduced does not contain bitcode. Well, I don't know what bitcode is, so I have to look at the goods first.
What is Bitcode?
Looking for something, the first thing to think about is to look at the official documents first. In the APP distribution Guide–app thinning (IOS, WatchOS) section, the following definition is found:
Bitcode is an intermediate representation of a compiled program. Apps upload to ITunes Connect that contain bitcode'll be compiled and linked on the App Store. Including Bitcode'll allow Apple to re-optimize your app binary on the future without the need to submit a new version O F 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 binaries of our program at a later stage without requiring us to resubmit a new version to the App Store.
Well, it looks pretty high.
Keep looking, in the What's New in Xcode-new Features in Xcode 7, there is a section of the following description
Bitcode. When you archive for submission to the app Store, Xcode would compile your app into an intermediate representation. The App Store would then compile the bitcode to the the or the executables as necessary.
When we submit a program 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 are placed in the app thinning (app slimming) section, you can see that it is related to the optimization of the package. Meow (@onevcat) also describes some of the improvements that Apple has made in app slimming in iOS 9 in the new features of the iOS 9 SDK that its blog developers need to know, and you can transition there to read it.
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, or dis Able 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.
The corresponding Ios,bitcode is optional.
is necessary for Watchos,bitcode.
MAC OS does not support Bitcode.
If we open the Bitcode, the following interface will also have a bitcode option when submitting the package:
Pirate diagram, my application is not able to display bitcode in this interface, because it relies on third-party libraries, and this library does not support Bitcode, temporarily only set Enable_bitcode to No.
Therefore, if our project needs to support Bitcode, it is necessary to require all the introduced third-party libraries to support Bitcode. I'll just have to wait for the company. What time does the Big Brother sister give us a new bag?
Off Topic
As mentioned above, Bitcode is an intermediate code. LLVM Official document has the format of introducing this file, interested can be LLVM bitcode file format.
Reference
APP Distribution Guide–app thinning (IOS, WatchOS)
What's New in Xcode-new Features in Xcode 7
What developers need to know about IOS 9 SDK new features
LLVM Bitcode File Format
Understanding Bitcode: An intermediate code