jedisct1/swift-sodium

Unable to run on iOs Simulator with XCode 13

Skycoder42 opened this issue · 1 comments

When trying to run a project with swift-sodium on XCode 13, targeting the iOs Simulator, you will get an error message containing

building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

According to https://stackoverflow.com/a/63955114, this is an issue with M1 support and can be fixed by adding the following lines to to the Podspec:

s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }

Note: I have no clue about XCode and Pods, this seems to be the problem and helped me fix the issue locally.

When trying to run a project with swift-sodium on XCode 13, targeting the iOs Simulator, you will get an error message containing

building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

According to https://stackoverflow.com/a/63955114, this is an issue with M1 support and can be fixed by adding the following lines to to the Podspec:

s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }

Note: I have no clue about XCode and Pods, this seems to be the problem and helped me fix the issue locally.

Thanks. this problem already exists so
In Flutter:
add this line in pod_install PodFile:
installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" end