"Module compiled with swift 3.0.2 cannot be imported in swift 3.1"

Xcode Version 8.3 beta 2 (8W120l)


Any idea how can I solve it?

Replies

Module compiled with swift 3.0.2 cannot be imported in swift 3.1

You’ll have to build that module in Swift 3.1. As things currently stand all modules in your program (that is, the main app and any frameworks) must be built with the same version of the compiler. It seems that you’re using Swift 3.0.2 to build some part of your app and Swift 3.1 to build another. That’s just not going to work.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

hey sorry I am new in swift and having the same issue but im not sure how can I build a module while i am importing another library

Cleaning your project and rebuilding could help, probably that module had been build with an older version of Xcode

If that is the case how can anyone possibly use any 3rd part frameworks or libraries? Its one thing to require that I have the same version or newer, but to say that I can't use any frameworks that were compiled in an older version doesnt make any sense. Not all companies will always have the a version of their framework rebuilt just because Apple updated their version of swift. And this is only dot release, not a major release.

Unfortunately, the only answer to everything you've said is, 'Yep'.


There was an expectation of this kind of stability in Swift 4 but I believe it has been pused out even farther now.


(It has become another joke, like trying out Xcode's "Refactor" option to make sure that the "Can’t refactor Swift code." alert still works.)

Hi, I am getting this error while working through Apples new Book "App Development with Swift"

This is part of Apples "Everyone can code"-program, see: https://www.apple.com/education/everyone-can-code/

Part of the book is a students download, called "AppDevelopmentSwift-Student".

Here chapter 1, part 8, UsingDocumentation contains a Framework "LabFramework.framework"

Using this framework yields exactly the error

"Module compiled with swift 3.0.2 cannot be imported in swift 3.1"

I can not find any source code for this framework.

I'm having the same issue!

The book, "App Development with Swift" from the iBooks store is what this thread refers to.


At the end of the introduction, there is a link to download student materials from https://developer.apple.com/go/?id=app-dev-swift-student


That download contains a framework called LabFramework.framework.


It was apparently compiled with 3.0.2.


Source is not included, so students do not have the opportunity to recompile with 3.1.

The book, "App Development with Swift" from the iBooks store is what this thread refers to.

Ah, thanks. It took me a while but I eventually tracked down that reference. And yes, it looks like you’ll need to download and install Xcode 8.0 if you want to use that framework. You can get older Xcode versions from the developer downloads page.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

WWDC runs Mon, 5 Jun through to Fri, 9 Jun. During that time all of DTS will be at the conference, helping folks out face-to-face. http://developer.apple.com/wwdc/

So I'm not really clear on why an Apple authored resource in the iBooks Store: “App Development with Swift” by Apple Education https://itun.es/us/SoKQib.l would reuqire a framework to be used in an intro to Swift that's not compatible with the most recent version of XCode. Seems like an unnecessary set of hurdles especially for the target audience.

I feel the same. I spent this morning updating because my iPad was already on 10.3 and I'd had a different exercise give me a build error, so I updated Xcode per instructions I'd found elsewhere - only to land on this. So I can't use an older version of Xcode because I can't push apps to my iPad if I do, but I can't be on this version of Xcode because the exercises in the tutorial were built under Swift 3.0.1 and I can't use those libraries. I'm pretty excited about the future right now

>I'm pretty excited about the future right now


Same here - imagine when Swift is fully matured, and they release the ABI.

The most elegant solution would be to also release the sources of that library so anyone can compile it with new version.


BTW - I have the same problem

I too am having this same proble