Xcode7運行項目時出現了如下的錯誤:
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 armv7
關于什么bitcode的錯誤,那bitcode是個什么鬼呢?
什么是 bitcode ?
通俗解釋:在線版安卓ART模式。
Apple 官方文檔-- 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 上。
在 Xcode簡介--- 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 會再將這個 bitcode 編譯為可執行的64位或32位程序。
請看這里 :http://blog.csdn.net/soindy/article/details/48518717
如果你的應用也準備啟用 Bitcode 編譯機制,就需要注意以下幾點:
* Xcode 7默認開啟 Bitcode ,如果應用開啟 Bitcode,那么其集成的其他第三方庫也需要是 Bitcode編譯的包才能真正進行 Bitcode 編譯
- 開啟 Bitcode 編譯后,編譯產生的 .app 體積會變大(中間代碼,不是用戶下載的包),且 .dSYM文件不能用來崩潰日志的符號化(用戶下載的包是 Apple 服務重新編譯產生的,有產生新的符號文件)
- 通過 Archive 方式上傳 AppStore 的包,可以在Xcode的Organizer工具中下載對應安裝包的新的符號文件
出現的問題原因是什么呢?
原來是某些二進制庫不支持bitcode.而Xcode默認是要支持bitcode的,而且如果支持的話,其中所有的二進制庫和framework都必須包含bitcode.
怎么樣解決呢?
我們可以直接將bitcode直接關掉就可以了。target ---> Built Seeting --->搜索 bitcode? --->將Yes置為No
如圖所示: