Carthage: Can't use Swift 4 and Swift 3.2 projects in Xcode 9

Created on 6 Jun 2017  路  5Comments  路  Source: Carthage/Carthage

At WWDC, they've announced support for using both Swift 3 and 4 code in the same project. Currently, trying to use Xcode 9 and Swift 4 to write an app with Swift 3.2 frameworks will not work. I spoke to an Apple engineer who stated that this is a Carthage issue. Are there any workarounds?

  • carthage version: 0.23
  • xcodebuild -version: 9M136h

Carthage Output

*** Skipped installing (framework) binary due to the error:
    "Incompatible Swift version - framework was built with 3.1 and the local version is 4.0."

Most helpful comment

Workaround for now is to just switch to new Xcode and carthage picks that up and compiles dependencies with new xcodebuild

sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

After that, I was able to compile the app with new Xcode successfully.

All 5 comments

* Skipped installing (framework) binary due to the error:

This is just a warning and doesn't mean anything except that we don't think we can use the prebuilt binary. Was your project otherwise able to build?

I'm planning to visit a lab later today to talk to the Xcode team about how Carthage can best support mixed Swift versions.

Workaround for now is to just switch to new Xcode and carthage picks that up and compiles dependencies with new xcodebuild

sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

After that, I was able to compile the app with new Xcode successfully.

Doesn't work for me. I get these errors when setting Xcode 9 as the default:

Invalid architecture UUIDs: Could not parse UUIDs using dwarfdump from /Users/[some path]/Vendor/Carthage/Build/Mac/ObjectiveDropboxOfficial.framework/ObjectiveDropboxOfficial

Invalid architecture UUIDs: Could not parse UUIDs using dwarfdump from /Users/[some path]/Vendor/Carthage/Build/Mac/Reachability.framework/Reachability

I get these errors when setting Xcode 9 as the default:

Can't reproduce that locally using https://github.com/dropbox/dropbox-sdk-obj-c.

Maybe there was something off on my computer. I tried using Xcode 9 for building, and everything seems to work well. I'm going to close this.

@lvandal: I doubt your issue is with Carthage, it might be the frameworks.

Was this page helpful?
0 / 5 - 0 ratings