Can't convert to Swift 4 because can't find framework module

I have a small macOS application with an embedded framework, both written in Swift 3.1. Each has its own Xcode project in separate locations on my Mac, and I use an Xcode workspace to develop and build both at once. I do not use CocoaPods or Carthage. My application and framework build and run successfully in Xcode 9 beta 6 under Swift 3.2.


When I try to convert to Swift 4 using the Xcode conversion command, it fails with a "no such module" error for the framework.


My online research shows that "no such module" errors have been plaguing developers who use embedded frameworks for several years. A dozen or more solutions have been suggested online, and they apparently work in some contexts but not in others. None of them work for me.


Has anybody successfully run the Xcode Swift 4 conversion command with an embedded framework and everything written in Swift? If so, can you spell out the key setup features that made it work for you?

I'm having the exact same problem. Pretty frustrating that it's gone this long with no attention from Apple.

I was finally able to do the conversion by copying the framework into the application project and converting all the code at once. Then I moved the framework back out to its own project, and all is working.

That worked for me, thanks.


I have a framework project, with example targets inside, for iOS, macOS and tvOS.


In the example projects I had to remove the framework from the "embedded binaries" and from the "linked frameworks and libraries", then copied the entire framework's source code into the Example projects, converted the Examples to Swift 4, then removed the code and added the framework as it was initially.


I'm using Xcode 9 GM

If you're feeling adventurous you can migrate to Swift 4 manually. Switch the SWIFT_VERSION to 4.0, and then update the code until the app builds. Not ideal, but it may be easier than copying the framework code into the app.

Can't convert to Swift 4 because can't find framework module
 
 
Q