user2452063 user2452063 - 1 month ago 291
Swift Question

Module compiled with swift 3.0 cannot be imported in Swift 3.0.1

Sorry if this is an obvious question, I upgraded Xcode this morning to 8.1 GM and am now getting the below error for SwiftyJSON. Other imported frameworks seem to work. Is there a way to force this to work in Swift 3 until SwiftyJSON upgrades their framework? I used Carthage to import/update frameworks. I also tried changing "Use Legacy Swift language version" On and Off to no avail. Sorry if this is an easy one, new to Swift dev.

"Module compiled with Swift 3.0 cannot be imported in Swift 3.0.1: Modules/SwiftyJSON.swiftmodule/arm64.swiftmodule"

Answer

Make sure you've placed the new XCode 8.1 GM package in your Applications folder. We ran into this issue when one of us was running Carthage to update our dependencies, but had not replaced the XCode old 8.0 application in the applications folder (8.1 GM was running off the Desktop).

You want to make sure that when you run the following in terminal: xcrun swift -version that it returns Apple Swift version 3.0.1.

Comments