(CocoaPods) - Pod lint fails when containing dynamic-frameworks without simulator architectures #...

一杯缺、先上原文

原文

二霹疫、問題:

Currently pod trunk is not usable for us as pod lint fails because simulator architectures (i386 and x86_64) are missing. BUT Apple rejects apps containing dynamic-frameworks with simulator architectures.

We deploy two variants of dynamic-framworks

  • one with all device and simulator architectures (for debugging)
  • one with device-only architectures (for app-submission).

pod lint fails with the following errors:

x86_64 in file SampleSDK/iOS/Sample.framework/Sample (3 slices)

  • NOTE | [SampleSDK/SampleSDK and more...] xcodebuild: fatal error: lipo: -remove's specified would result in an empty fat file
  • NOTE | [iOS] [SampleSDK/SampleSDK] xcodebuild: ld: warning: ld: warning: ignoring file SampleSDK/iOS/Sample.framework/Sample, missing required architecture x86_64 in file

We were forced to provide device-only architectures as Apple rejects app-submissions containing any simulator-architectures with

ERROR: ERROR ITMS-90087: "Unsupported Architectures. The executable for Sample.app/Frameworks/Sample.framework contains unsupported architectures '[x86_64, i386]'."

Similar issues:
#5275
http://stackoverflow.com/questions/36618252/cocoapods-podspec-push-without-build-simulator-architecture

三全景、答案

方法一:

@eldewy I managed to go around this issue by replacing the code inside the xcodebuild function of validator.rb by that one :

def xcodebuild
require 'fourflusher'
command = ['clean', 'build', '-workspace', File.join(validation_dir, 'App.xcworkspace'), '-scheme', 'Pods-App', '-configuration', 'Release']
case consumer.platform_name
when :ios
command += %w(-sdk iphoneos10.0 -destination=generic/iOS ONLY_ACTIVE_ARCH=NO ARCHS=armv7)
when :watchos
command += %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator)
command += Fourflusher::SimControl.new.destination(:oldest, 'watchOS', deployment_target)
when :tvos
command += %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
command += Fourflusher::SimControl.new.destination(:oldest, 'tvOS', deployment_target)
end

  output, status = _xcodebuild(command)

  unless status.success?
    message = 'Returned an unsuccessful exit code.'
    message += ' You can use `--verbose` for more information.' unless config.verbose?
    error('xcodebuild', message)
  end
  output
end

I basically replicated the behaviour of 0.39 to allow our team to push pods. Please note that this is a quick and dirty fix, will only work for ios targets, is only working with xcode8, and might not work for you, but I thought it might help you while waiting for an official fix ;)

方法二:

Hi,
I also ran into the same issue while creating a private pod to wrap a third-party which does not provide i386 libraries : pod lib lint resulted into Undefined symbols for architecture i386.
Finally, I came up with the following workaround (which is a posteriori natural, since my project really doesn't need to be built on i386) : tell the podspec that the project is not buildable on 32 bit simulators, that is :

    subspec.pod_target_xcconfig = {
        'ARCHS[sdk=iphonesimulator*]' => '$(ARCHS_STANDARD_64_BIT)'
    }

(instead of the default ARCHS_STANDARD)

In case it helps... @MarcoBrescianini @dvdblk @lumialxk

方法三(已驗證可行):

I almost have the same case with @hberenger . But the third-party in my private pod does not include both i386 and x86_64 libraries.
I add pod_target_xcconfig like this:

s.pod_target_xcconfig = { 'VALID_ARCHS[sdk=iphonesimulator*]' => '' }

after that, pod lib lint --skip-import-validation works for me.

I just hope "the lint" can ignore architecture i386 and x86_64. I'm not sure whether it is the right way, though it works.

方法四:

This show how to fix

when :ios
        command += %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator ARCHS=x86_64)

https://github.com/caixindong/Cocoapods_fix_i386/blob/master/validator.rb

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末艾蓝,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子粪牲,更是在濱河造成了極大的恐慌古瓤,老刑警劉巖,帶你破解...
    沈念sama閱讀 206,968評論 6 482
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件腺阳,死亡現(xiàn)場離奇詭異落君,居然都是意外死亡滴须,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,601評論 2 382
  • 文/潘曉璐 我一進(jìn)店門叽奥,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人痛侍,你說我怎么就攤上這事朝氓。” “怎么了主届?”我有些...
    開封第一講書人閱讀 153,220評論 0 344
  • 文/不壞的土叔 我叫張陵赵哲,是天一觀的道長。 經(jīng)常有香客問我君丁,道長枫夺,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 55,416評論 1 279
  • 正文 為了忘掉前任绘闷,我火速辦了婚禮橡庞,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘印蔗。我一直安慰自己扒最,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 64,425評論 5 374
  • 文/花漫 我一把揭開白布华嘹。 她就那樣靜靜地躺著吧趣,像睡著了一般。 火紅的嫁衣襯著肌膚如雪耙厚。 梳的紋絲不亂的頭發(fā)上强挫,一...
    開封第一講書人閱讀 49,144評論 1 285
  • 那天,我揣著相機與錄音薛躬,去河邊找鬼俯渤。 笑死,一個胖子當(dāng)著我的面吹牛型宝,可吹牛的內(nèi)容都是我干的稠诲。 我是一名探鬼主播,決...
    沈念sama閱讀 38,432評論 3 401
  • 文/蒼蘭香墨 我猛地睜開眼诡曙,長吁一口氣:“原來是場噩夢啊……” “哼臀叙!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起价卤,我...
    開封第一講書人閱讀 37,088評論 0 261
  • 序言:老撾萬榮一對情侶失蹤劝萤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后慎璧,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體床嫌,經(jīng)...
    沈念sama閱讀 43,586評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡跨释,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,028評論 2 325
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了厌处。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片鳖谈。...
    茶點故事閱讀 38,137評論 1 334
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖阔涉,靈堂內(nèi)的尸體忽然破棺而出缆娃,到底是詐尸還是另有隱情,我是刑警寧澤瑰排,帶...
    沈念sama閱讀 33,783評論 4 324
  • 正文 年R本政府宣布贯要,位于F島的核電站,受9級特大地震影響椭住,放射性物質(zhì)發(fā)生泄漏崇渗。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 39,343評論 3 307
  • 文/蒙蒙 一京郑、第九天 我趴在偏房一處隱蔽的房頂上張望宅广。 院中可真熱鬧,春花似錦些举、人聲如沸乘碑。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,333評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽兽肤。三九已至,卻和暖如春绪抛,著一層夾襖步出監(jiān)牢的瞬間资铡,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,559評論 1 262
  • 我被黑心中介騙來泰國打工幢码, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留笤休,地道東北人。 一個月前我還...
    沈念sama閱讀 45,595評論 2 355
  • 正文 我出身青樓症副,卻偏偏與公主長得像店雅,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子贞铣,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 42,901評論 2 345

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