Now that more and more teams migrate to use Xcode 8 we saw a couple of frequent issues reported by our users.
One of the most frequent ones is related to CocoaPods and the Swift version. The error looks something like:
** ARCHIVE FAILED **
The following build commands failed:
The first step if you get an error like this and you don't see more details about the error in the log, is to switch the Output Tool option of the related Xcode step to xcodebuild. The default value is xcpretty, which is an awesome Xcode log formatter tool, but in some cases it omits important details about the error.
In the raw xcodebuild log if you have an error like:
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
and you use CocoaPods, the most likely cause of the error is that CocoaPods might not set your pod projects' swift version correctly.
You can find the related CocoaPods issue on GitHub, and as mentioned there the fix is to add the following code to your Podfile:
Huge thanks for @snydersaurus who reported this and the fix on our Slack!
Happy Building! 🚀