Swift framework, compatibility

Hello,


recently i've created a framework using swift. It was written using xcode 7.2.1.

After a while, the client which is using this frameworks says that his app won't lauching anymore.

So, this app crashes on launch saying:

Reason: Incompatible library version: MyFrameworkKit requires version 1.0.0 or later, but libswiftCore.dylib provides version 0.0.0

The only way to fix this is to rebuild my framework using the same xcode version as for target app.

It's ok for one app, but if will distrubute this framework over a lot of projects where i can't control which xcode versions they are using?

It is way to build this framework once and for all versions?


Thanks in advance.

Replies

Currently, Swift does not support building frameworks that are distributed as binaries. All Swift code in all targets of an app must be compiled with the same version of Swift.


This is because the Swift ABI (application binary interface) is not locked down yet, so the rules change with every version of the Swift compiler. In addition the Swift library itself is still changing, so even if the ABI was compatible, the library functions would be different.


Obviously this is not an ideal situation, and it's taking longer to get to a stable ABI than anyone really anticipated.