Swift ABI stability: Module compiled with Swift X.Y cannot be imported by the Swift X.Z compiler

Let's start by existing questions,

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

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

Module compiled with Swift 5.1.2 cannot be imported by the Swift 5.2.4 compiler


And, now with XCode 12(12A7209)

Module compiled with Swift 5.2.4 cannot be imported by the Swift 5.3
compiler

The framework was compiled in the lower version of Swift (Swift 5.2.4). However, it worked perfectly with XCode 12 beta.

Along with the above solutions, I have a update the setting Build Libraries for Distribution to Yes

Whole point is the Swift ABI stability for binary framework and how to achieve it across different swift version.

Please advice. Thank you in advance!

Along with the above solutions, I have a update the setting Build Libraries for Distribution to Yes 

The settings is needed when compiling the framework. Are you sure it was set to YES when the framework was built?
@OOPer Yes, it was set correctly.

Build Libraries for Distribution to Yes

Yes, it was set correctly. 

Thanks for confirmation.
Then, it may be a bug of Xcode 12. You may need to send a bug report and wait till it to be fixed.
Or need to build the framework again from source code.

Then, it may be a bug of Xcode 12. You may need to send a bug report and wait till it to be fixed. Or need to build the framework again from source code.

Thanks for the response.

The pain point is that with every Swift, I need to use the compatible XCode version and release a framework again and again.
Eg.:
  • Swift 5.1 -> Xcode 11.1

  • Swift 5.1.2 & Swift 5.1.3 -> Xcode 11.2.1

  • Swift 5.2 -> XCode 11.4

  • Swift 5.3 -> XCode 12

How can we have a Swift Universal Binary Framework works across all swift version?


How can we have a Swift Universal Binary Framework works across all swift version? 

As far as I know, properly built frameworks (I mean the setting Build Libraries for Distribution to Yes) can be used in all versions of Xcode 11.x.
You may need to build two versions of your framework, for Xcode 11.x and for Xcode 12 until this issue is fixed.
I am facing the same issue. Please help.
Swift ABI stability: Module compiled with Swift X.Y cannot be imported by the Swift X.Z compiler
 
 
Q