The legacy build system does not support building projects with Swift when SWIFT_ENABLE_LIBRARY_EVOLUTION is enabled.

Hello,

Since Xcode 11.5 has been updated, I had problems with my projects third party frameworks (RealmSwift).
First I had a message "Module compiled with Swift 5.1.2 cannot be imported by the Swift 5.2.4 compiler".

To resolve this issue, I set BUILD LIBRARY FOR DISTRIBUTION to YES on the project's build settings.

This causes the error "The legacy build system does not support building projects with Swift when SWIFTENABLELIBRARY_EVOLUTION is enabled."

Could you please tell me how can I use realmSwift with the new compiler ?

Thank you in advance.

The error message indicates that you're using a binary framework that was compiled with a previous Swift compiler version without the BUILD_LIBRARY_FOR_DISTRIBUTION build setting. You'll need to contact the vendor of that framework to get a version that was built for distribution. (Or, failing that, a version that was built with the same Xcode as the version you're using.)

You can switch to the modern build system in Xcode's Shared Project Settings dialog under File > Project Settings. (It is a good idea to do so -- if you run into an issue that prevents you from enabling the modern build system, please submit feedback describing the problem!) However, enabling the BUILD_LIBRARY_FOR_DISTRIBUTION build setting in your app target will not resolve this issue. To allow using the same framework binary across Swift compiler versions, the build setting needs to be enabled in the framework dependency.

For more information, please see the "Binary Frameworks in Swift" session from WWDC 2019.
The legacy build system does not support building projects with Swift when SWIFT_ENABLE_LIBRARY_EVOLUTION is enabled.
 
 
Q