我将 Xcode 升级到 Xcode 12,并构建了我的项目。首先,它出现如下错误:
ld:为 iOS 模拟器构建,但在为 iOS 构建的 dylib 中链接,文件“/Users/ethanli/Documents/Aspira/RA.com4iOS/RA.com4iOS/source/ReserveAmerica/ReserveAmerica4/External/Mapbox/MapboxMobileEvents.framework/MapboxMobileEvents”用于架构 arm64
我通过在 Build Settings 中向 Excluded Architecture 添加“arm64”消除了这个错误。参考 https://developer.apple.com/forums/thread/656509
但是……又出现了一个错误:
错误:无法找到构建输入文件:'/Users/ethanli/Library/Developer/Xcode/DerivedData/ReserveAmerica4-cgnruuknmgycgrbadguodtkwspmy/Build/Products/DEBUG-iphonesimulator/ReserveAmerica4.app/ReserveAmerica4'(在目标 4 'from projectAmerica' ReserveAmerica4')
我去Finder的路径,“ReserveAmerica4”真的不存在。
有没有办法解决这个问题?
Eth*_* Li 20
我解决了这个错误。
根本原因是 Xcode 12 不允许为模拟器构建 arm64 架构。我们应该为模拟器构建设置 x86_64。
有关更多答案:Xcode 12,为 iOS 模拟器构建,但链接为 iOS 构建的目标文件,用于架构 arm64
小智 12
你可以用这个修复它
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
Run Code Online (Sandbox Code Playgroud)
Fli*_*bor 12
我在 M1 Silicon 遇到同样的错误。但是将arm64添加到“排除+仅构建活动架构”并没有帮助,因为一个库失败并出现:For builds to run in the simulator, this should be set to "x64"错误。
对我有用的临时解决方案:
| 归档时间: |
|
| 查看次数: |
22882 次 |
| 最近记录: |