Convert to Current Swift Syntax Failed - "No such module" (Swift 4, Xcode 9)

Nikolay Suvandzhiev picture Nikolay Suvandzhiev · Sep 21, 2017 · Viewed 11.4k times · Source

In Xcode 9, I am trying to do the automatic conversion to Swift 4. It fails with the following message:

enter image description here

Convert to Current Swift Syntax Failed
Please ensure that all selected targets build successfully with the currently configured Swift version before attempting a migration.

It's complaining of a missing module. But when I do a regular build there are no issues. Not sure if this is relevant, but the module (which Xcode is complaining is missing) was already converted to Swift 4 earlier (in it's own project).

Note: No Cocoapods / Carthage used here.

Note: Two solutions tried (and worked) but do not address the underlying issue.

  • One solution is to do the conversion manually (change Swift version to 4 in build setting and apply Fix-Its one by one until no more build errors).
  • Another solution is to disable the third party framework (comment out all code where it's used), do the auto-migration, and then re-enable the framework. This could get pretty difficult with bigger projects.

Answer

Luca Davanzo picture Luca Davanzo · Sep 29, 2017

I can't find any solution yet.

For now I fix manually setting Swift Language Version

enter image description here

After changing from 3.2 to 4.0 I compile and fix errors and warnings manually.
I'm waiting for a better solution!