Gaurav Wadhwani
Gaurav Wadhwani

Reputation: 1352

Xcode 10.1 Swift Compiler Error with CocoaPods

I'm using Xcode 10.1 with my iOS app. I recently updated my app to Swift 4.2. Naturally the code of the app has been upgraded and I followed this link to get all my pods in line (compiling supported pods with Swift 4.2 and unsupported ones with Swift 3).

Now, I've cleaned my project multiple times, deleted the derived data folder and set the SWIFT_ENABLE_BATCH_MODE to NO for the main app target and individual pods that are causing the issue. But none of these fixes seem to work.

I continuously receive the error: Command CompileSwift failed with a nonzero exit code for my CocoaPods.

And it mainly appears to occur with pods that are supposed to be compiled with Swift 4.2. The pods that are set to compile with earlier versions look fine at the moment.

How could this be fixed?

Upvotes: 2

Views: 2779

Answers (1)

Darrell Root
Darrell Root

Reputation: 844

It may be worth trying cocoapods 1.6 beta. I ran into a similar but not identical bug "SwiftGenKit-SwiftGenKit UnitTests-frameworks.sh: line 104: EXPANDED_CODE_SIGN_IDENTITY: unbound variable Command PhaseScriptExecution failed with a nonzero exit code" documented here:

https://github.com/CocoaPods/CocoaPods/issues/7708

In that case the fix is understood and integrated into 1.6 beta but not 1.5.latest.

Check out http://blog.cocoapods.org/CocoaPods-1.6.0-beta/ for beta information, including this key upgrade command:

gem install cocoapods --pre

I recommend exiting Xcode while executing the cocoapods upgrade and then cleaning your Xcode build folder.

Upvotes: 2

Related Questions