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 non
So I had same issue when updating my project to Swift 5. For some reason, Cocoapods (latest version, 1.6.1) set the SWIFT_VERSION of some pods to Swift 5 even if they're released as Swift 4, 4.1, 4.2 pods. So I had to add a post install script that set the correction version of swift like so
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'CryptoSwift' || target.name == 'SwiftyBeaver'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
end
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
In my case it just appeared probably because I ran project again while it was building. So what I did was not only clean but also folder clean my project using
SHITF + ALT + COMMAND + K
also I deleted derived data and the project was up and running again.
you can follow this steps...
You are getting all those error's just because of pods..so either you need to update every pod that you are using.
I had the same issue after upgrading to Xcode 10.2. After following the steps below it worked for me:
I had to set "Optimization Level" in "Swift Compiler - Code Generation" to "Release" - "No Optimization [-Onone]" from "Optimize for speed" to make Cache pass Archive.
Same with SwiftyBeaver
It seems a problem related to Xcode 10.2. Also other pod projects seems to be fine with Optimization, like Toucan or XCGLogger.