0

I recently started my very first swift experience and I got an error

'Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.0 compiler'

I thought that I can moderate this error just selecting my swift language version on build settings. but it doesn't work.

enter image description here

After few searching, I found that there are two options

  1. Downgrade Xcode
  2. Update modules or Rebuild modules using swift 5.0

Are they only options I got? I don't know why changing swift language version does not do anything.

1 Answer 1

1

The swift 5 compiler which is bundled with Xcode 10.2 can compile in swift 4 mode. However, it is still the swift 5 compiler and not the swift 4 compiler that came in Xcode 10.1. Modules built with the swift 4 compiler can’t be imported by the swift 5 compiler.

Therefore, the two options you listed are the only options you have.

Sign up to request clarification or add additional context in comments.

2 Comments

Yup. The following link gives you more details. Module stability (which you want) might come in Swift 6. swift.org/blog/abi-stability-and-more
I ended up with downgrading my xcode. 😂 but anyway thank you for your nice and precise explanation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.