前言花墩,打算給女兒寫一個(gè)認(rèn)識(shí)小動(dòng)物的游戲复斥,在模擬器上跑起來沒事营密,但是真機(jī)上跑突然就出現(xiàn)各種奇怪的錯(cuò)誤。
最后各種搜索永票,各種折騰卵贱,才發(fā)現(xiàn)是我的 architectures 設(shè)置的不對(duì),在excluded Architecture寫的不對(duì)侣集,我在debug和release 后面也加了 arm64,
直到我修改成如圖的键俱,立刻就好了。
第一 pod 文件中加上 只支持arm64
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
第二 設(shè)置 architectures
image.png
必須這樣寫 不然會(huì)出很多奇怪的錯(cuò)誤
錯(cuò)誤1: No such module
錯(cuò)誤2: [The linked library 'libPods-xxx.a' is missing one or more architectures required by this target: armv7.]
錯(cuò)誤3: Command PhaseScriptExecution failed with a nonzero exit code
錯(cuò)誤4: xxx/Pods/Target Support Files/Pods-xxx/Pods-xxx-frameworks.sh: line 121: ARCHS[@]: unbound variable
這些錯(cuò)誤都是因?yàn)?target 的 Deployment Target 的選擇 和 pod 文件的設(shè)置(步驟1)還有 Architectures設(shè)置 導(dǎo)致的世分。
并不像他們所說的由于workspace 導(dǎo)致的编振,中文技術(shù)圈,一言難盡啊,除了抄襲就不會(huì)別的踪央。