CocoaPods issue (and fix) with Xcode 8

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.


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:
   Check dependencies

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:

Check dependencies
“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:


post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '2.3'
    end
  end
end
Copy code

Huge thanks for @snydersaurus who reported this and the fix on our Slack!

Happy Building! 🚀

No items found.
The Mobile DevOps Newsletter

Explore more topics

App Development

Learn how to optimize your mobile app deployment processes for iOS, Android, Flutter, ReactNative, and more

Bitrise & Community

Check out the latest from Bitrise and the community. Learn about the upcoming mobile events, employee spotlights, women in tech, and more

Bitrise Insights

Cache | Caching

Mobile App Releases

Learn how to release faster, better apps on the App Store, Google Play Store, Huawei AppGallery, and other app stores

Mobile DevOps

Learn Mobile DevOps best practices such as DevOps for iOS, Android, and industry-specific DevOps tips for mobile engineers

Mobile Testing & Security

Learn how to optimize mobile testing and security — from automated security checks to robust mobile testing and more.

Product Updates

Check out the latest product updates from Bitrise — Build Insights updates, product news, and more.

The Mobile DevOps Newsletter

Join 1000s of your peers. Sign up to receive Mobile DevOps tips, news, and best practice guides once every two weeks.