Xcode12 編譯報(bào)錯(cuò): built for iOS, for architecture arm64...

升級Xcode12后,編譯項(xiàng)目時(shí),可能會(huì)出現(xiàn)以下錯(cuò)誤:

building for iOS Simulator, but linking in object:

building for iOS Simulator, but linking in object ... file built for iOS, for architecture arm64

Embedded binary is not signed with the same certificate:

Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.
Embedded Binary Signing Certificate: XXX 
Parent App Signing Certificate: XXX 

.app" couldn’t be opened because you don’t have permission to view it.:

The file "XXX.app" couldn’t be opened because you don’t have permission to view it.

產(chǎn)生這些報(bào)錯(cuò)的根本原因是新版本的Xcode 12更改了編譯架構(gòu)的設(shè)置方式

舊版本的Xcode編譯架構(gòu)設(shè)置方式: 用Xcode打開項(xiàng)目 -> Project -> PROJECT -> Build Setting ->

  1. 首先在Architectures -> Valid Architectures -> 設(shè)置可用的編譯架構(gòu)指令集
  2. 然后在User-Defined -> EXCLUDED_ARCHS -> 設(shè)置排除的編譯架構(gòu)指令集

新版Xcode12的編譯架構(gòu)設(shè)置方式: 用Xcode打開項(xiàng)目 -> Project -> PROJECT -> Build Setting ->

  1. 首先在Architectures -> Excluded Architectures -> 排除的編譯架構(gòu)指令集
  2. 然后在User-Defined -> VALID_ARCHS -> 設(shè)置可用的編譯架構(gòu)指令集

因此,解決上述問題的方案就是在新版的Xcode12中設(shè)置:

  1. 在Architectures -> Excluded Architectures -> 設(shè)置排除的編譯架構(gòu)指令集為"arm64"。(建議只設(shè)置Debug模式,Release模式還是要支持arm64的,否則打包后無法在真機(jī)上海安裝)
  2. 同時(shí),刪除User-Defined中的VALID_ARCHS欄,即可用的編譯架構(gòu)指令集的設(shè)置(操作方法:選擇PROJECT -> Build Setting ->User-Defined ->選中VALID_ARCHS,直接按Delete鍵)。
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容