I'm using Xcode 10.2, Swift 5.
With Debug scheme, no issue happens, but with Release scheme when I build or archive, it shows Command compileSwift failed with a nonzero exit code.
I've tried delete DerivedData / Clean / pod deintegrate & pod install & pod update. None of these works.
For my project problem was related to pod Cache
which gives error when Optimization Level
for Release
is set to Optimize for Speed [-O]
. I have set Compilation Mode
to Whole Module
again and set optimization level for the pod in pod file:
post_install do |installer|
installer.pods_project.targets.each do |target|
# Cache pod does not accept optimization level '-O', causing Bus 10 error. Use '-Osize' or '-Onone'
if target.name == 'Cache'
target.build_configurations.each do |config|
level = '-Osize'
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = level
puts "Set #{target.name} #{config.name} to Optimization Level #{level}"
end
end
end
end
Refrence: https://github.com/hyperoslo/Cache/issues/233#issuecomment-477749560
I fixed this issue by going Pods Project then to the building settings and setting Compilation Mode to Incremental for Release. Then clean and archive, should compile fine then.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With