問題呢就是xocde7運行代碼發掘打開微信分享的代碼報錯啦, 報錯如下:
ld: '/Users/gti/Documents/安全寶寶/weiwu/微物/Others/Lib/SDKExport/libWeChatSDK.a(WXApiObject.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。
解決方法:1 讓第三方支持bitcode(不太可能實現)
2 那就關閉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。
