Xcode 11 beta 4 error: Command CompileSwiftSources failed with a nonzero exit code

There is a known issue with Cocoapods and Xcode 11 Beta 4 where inhibit_all_warnings! causes arguments to be set for Swift which do not compile. Removing this inhibit resolves the issue, and Swift warnings can be inhibited with SWIFT_SUPPRESS_WARNINGS = YES on targets instead.


CocoaPods had a fix for this that got released as part of CocoaPods 1.7.5.


Below is the answer preceding the 1.7.5 release:

If you need to use Xcode 11 Beta 4 in the mean time, you could install a patched version of CocoaPods from that pull request:

1. Open Gemfile, replace gem 'cocoapods' with

gem 'cocoapods', :git => 'https://github.com/dnkoutso/CocoaPods.git', :branch => "swift_compiler_warnings"

2. Run bundle install and bundle exec pod install

Keep in mind, this is a temporary solution.


The latest version of CocoaPods (1.7.5) has this issue fixed!

  1. In Terminal run

    sudo gem update cocoapods

  2. And then, on your project directory

    pod install