A module compiled with Swift 4.0 cannot be imported into Swift 3.2.1

Swift 4.0 modules were good in Swift 3.2 applications with Xcode 9.0.

But now, with Xcode 9.1, I get:

A module compiled with Swift 4.0 cannot be imported into Swift 3.2.1

Or:

A module compiled with Swift 4.0 cannot be imported into Swift 4.0.1

+5
source share
3 answers

Swift 4.0 is only compatible with Swift 3.2.
Swift 4.0.1 is only compatible with Swift 3.2.1.

So:

  • you cannot mix 4.0 and 3.2.1
  • you cannot mix 4.0.1 and 3.2
  • you cannot mix 4.0 and 4.0.1
  • you cannot mix 3.2.1 and 3.2

To formulate it in different ways:

  • You can combine the supported Xcode 9.0 versions of Swift.
  • You can combine the supported Xcode 9.1 versions of Swift.
  • You cannot mix versions of Xcode 9.0 and Xcode 9.1 Swift.

If the module was created by you, just rebuild it using the same Xcode.
If the module was created by a third party, request an assembly compatible with Xcode 9.1.

+8
source

This can be built using Swift 3.2 in Xcode 9.1 beta 2 by installing the Xcode 9.0 Toolbox and using it to create a project.

Swift Toolchain Image

Then select the version of Swift 4.0 from the menu Xcode → Toolchains.

You can now create using Swift 3.2 or 4.0 in Xcode 9.1 b2.

+6
source

Using the latest version of Xcode resolved this issue.

0
source

Source: https://habr.com/ru/post/1272483/


All Articles