Module '**' was created for incompatible target arm64-apple-ios8.0: /User/xx/xx
場景:Xcode12下,真機running成功,模擬器運行時如上報錯。
初步猜測:
根據錯誤提示,看到arm64條件反射,初步猜測是靜態(tài)庫/動態(tài)庫未加入模擬器架構導致報錯。
使用 lipo -info xx.framework/xx 命令檢查對應的module的架構,以及使用 file xx.framework/xx,發(fā)現報錯的庫是支持模擬器x86_64架構的動態(tài)庫。
查找資料,尋找解決方案
參考上面文章處理方法得到解決
解決方法如下兩步:
- 第一步,對應的target下的Build Setting下找到 Excluded Architecture,選擇Debug,將Any SDK 切換為 Any iOS Simulator SDK,添加 arm64 配置。
- 第二步,主項目 Podfile 文件配置
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
尋找原因
- Xcode升級12后,項目默認不包含模擬器的類型:x86_64(64位處理器的模擬器)
附:
XCODE12 在使用模擬器(SIMULATOR)時編譯錯誤的解決方法
iOS14適配和Xcode12模擬器運行兼容