Xcode12打包SDK發(fā)布到cocoapods驗(yàn)證失敗的解決方法

  • 錯(cuò)誤信息如下
** BUILD FAILED **
The following build commands failed:
Ld /Users/xxx/Library/Developer/Xcode/DerivedData/
App-ffbcalrxowejfwejfwpfjwpoe/Build/Intermediate.noindex/App.build/
Release-iphonesimulator/App.build/Objects-normal/arm64/Binary/App normal arm64

My understanding of this issue is that the cocoapods validation step is trying to build a dummy Xcode project for all architecture types. In Xcode 12, Apple introduced support for Apple Silicon and it uses arm64 for the simulator. For iOS x86_64 is used for the simulator.
My pod does not yet support Apple Silicon and I explicitly do not bundle an arm64 architecture slice for the simulator in my binary. Therefore when cocoapods was performing its validation and running an xcodebuild for all architectures, it failed when building for arm64 simulator architecture.

The solution is to explicitly exclude the arm64 architecture slice for the simulator by adding the following to the podspec.
s.pod_target_xcconfig = {
    'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
  }
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }

This will modify the pod and user build settings to exclude the arm64 architecture for the simulator. Most users will have Build For Active Architectures Only set to YES, so they won't see this. But if they don't this will prevent a build failure.

The long term solution is to use an XCFramework binary to distribute your pod because it will be able to bundle all architecture slices in the one binary.

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末映穗,一起剝皮案震驚了整個(gè)濱河市费什,隨后出現(xiàn)的幾起案子锄禽,更是在濱河造成了極大的恐慌秤掌,老刑警劉巖旬痹,帶你破解...
    沈念sama閱讀 217,406評論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件蛉谜,死亡現(xiàn)場離奇詭異讼庇,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)魁衙,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,732評論 3 393
  • 文/潘曉璐 我一進(jìn)店門报腔,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人剖淀,你說我怎么就攤上這事∠朔浚” “怎么了纵隔?”我有些...
    開封第一講書人閱讀 163,711評論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長炮姨。 經(jīng)常有香客問我捌刮,道長,這世上最難降的妖魔是什么舒岸? 我笑而不...
    開封第一講書人閱讀 58,380評論 1 293
  • 正文 為了忘掉前任绅作,我火速辦了婚禮,結(jié)果婚禮上蛾派,老公的妹妹穿的比我還像新娘俄认。我一直安慰自己,他們只是感情好洪乍,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,432評論 6 392
  • 文/花漫 我一把揭開白布眯杏。 她就那樣靜靜地躺著,像睡著了一般壳澳。 火紅的嫁衣襯著肌膚如雪岂贩。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,301評論 1 301
  • 那天巷波,我揣著相機(jī)與錄音萎津,去河邊找鬼。 笑死抹镊,一個(gè)胖子當(dāng)著我的面吹牛锉屈,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播髓考,決...
    沈念sama閱讀 40,145評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼部念,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起儡炼,我...
    開封第一講書人閱讀 39,008評論 0 276
  • 序言:老撾萬榮一對情侶失蹤妓湘,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后乌询,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體榜贴,經(jīng)...
    沈念sama閱讀 45,443評論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,649評論 3 334
  • 正文 我和宋清朗相戀三年妹田,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了唬党。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 39,795評論 1 347
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡鬼佣,死狀恐怖驶拱,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情晶衷,我是刑警寧澤蓝纲,帶...
    沈念sama閱讀 35,501評論 5 345
  • 正文 年R本政府宣布,位于F島的核電站晌纫,受9級特大地震影響税迷,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜锹漱,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,119評論 3 328
  • 文/蒙蒙 一箭养、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧哥牍,春花似錦毕泌、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,731評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至辩诞,卻和暖如春坎弯,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背译暂。 一陣腳步聲響...
    開封第一講書人閱讀 32,865評論 1 269
  • 我被黑心中介騙來泰國打工抠忘, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人外永。 一個(gè)月前我還...
    沈念sama閱讀 47,899評論 2 370
  • 正文 我出身青樓崎脉,卻偏偏與公主長得像,于是被迫代替她去往敵國和親伯顶。 傳聞我的和親對象是個(gè)殘疾皇子囚灼,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,724評論 2 354

推薦閱讀更多精彩內(nèi)容