0

Module compiled with Swift 5.1 cannot be imported by the Swift 5.0 compiler

I need to compile my sdk in swift 5.1 such that it should work in project build using swift 5

2 Answers 2

1

What I understand is module stability just included in Swift 5.1. Seem like Swift 5 still cannot use the framework that compiled with Swift 5.1 since module stability is not supported yet.

For your case, need to use compiled framework for specific Swfit version. i.e. If you gonna use for Swift 5 project, export your SDK with Swift 5 compiled. Same goes to Swift 5.1 project.

Swift 5.1, Module stability implemented https://swift.org/blog/swift-5-1-released/

Swift 5.0, Module stability still under development https://swift.org/blog/abi-stability-and-more/

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

Comments

0

it does not make sense to compile a project created using Swift 5.1 with 5.0. Swift 5.0 cannot know how to compile something that is in the future (5.1).

Therefore the answer is simply that you cannot do that, it does not make sense to do so.

2 Comments

Ok.So only way is I need to keep on updating my SDK based on swift versions?
Yes that would be best

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.