archive 打包出錯 apple mach-o linker (id) error

來源:互聯網
上載者:User

標籤:src   技術分享   去掉   lin   object   build   內容   最佳化   chm   

1: 情形: 編譯真機運行都可以,就打包時報錯

 

報錯內容
ld: bitcode bundle could not be generated because ‘/Users/liuyuning/Desktop/TestDecode/Decode/libDecode.a(Decode.o)‘ was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)



 

 

2: Bitcode是蘋果在Xcode7及以後推出的新功能。用於代碼的二次編譯,針對CPU進行最佳化,編譯工作由蘋果AppStore後台來完成。
針對iOS是可選項,預設開啟。watchOS 和 tvOS 是必選項。蘋果文檔如下

 

 

這時,就需要給靜態庫的工程增加一個選項“-fembed-bitcode”。之後就可以正常Archive了。

 

增加“-fembed-bitcode”





另外,如果靜態庫的工程有 -Werror 的選項,需要去掉。應為在編譯的時候有一個警告。 clang: warning: argument unused during compilation: ‘-fembed-bitcode-marker‘
如果不去掉就會報錯。


 

 

 

3:如果方法二無效,如果

 

 

那麼你選擇的第三發SDK也一定也要支援bitcode 為YES

 

archive 打包出錯 apple mach-o linker (id) error

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.