Xcode 12: building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
Basically you have to exclude arm64 for simulator architecture both from your project and the Pod project,
To do that, navigate to Build Settings of your project and add
Any iOS Simulator SDKwith valuearm64insideExcluded Architecture.
OR
- If you are using custom
XCConfigfiles, you can simply add this line for excluding simulator architecture.
EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64Then
You have to do the same for the Pod project until all the cocoa pod vendors are done adding following in their Podspec.
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }You can manually add the Excluded Architechure in your Pod project's Build Settings, but it will be overwritten when you use pod install.
In place of this, you can add this snippet in your Podfile. It will write the neccessary Build Settings every time you run pod install
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings[‘EXCLUDED_ARCHS[sdk=iphonesimulator*]’] = ‘arm64’
end
end最后自己研究出来的方案:
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64 i386' }
s.xcconfig = { 'EXCLUDED_ARCHS[config=*][sdk=iphonesimulator*]' => '$(inherited) arm64 i386' }

评论
发表评论