the compiler that produced it, 'Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8)

We are creating a framework using Xcode and it is working fine with Xcode 12.1 but not working on Xcode 12.2 & above.
When the adopter app imports the framework file it shows the below error
The compiler that produced it, 'Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8)

Replies

Your framework wasn't built with Library Evolution enabled, so different versions of the compiler can't use the binary.

There are two options to handle these situations:
  1. Ensure the framework is built from source as part of the app's build by configuring the project dependencies. See TN 2435. Alternatively, convert the framework to a Swift package, and integrate the package into your app through Swift Package Manager and built from source as an app dependency that way.

  2. If the framework needs to be built and versioned separate from the app, build the framework as an XCFramework with Library Evolution enabled and distribute the XCFramework. To learn about XCFrameworks, start with the WWDC session about them.

  • I have a dynamic binary XCFramework with enabled Library Evolution option (built with Xcode 13.x) integrated to main app (via pods) but failed to build the app in Xcode 12.x with error: failed to build module '***' from its module interface; the compiler that produced it, 'Apple Swift version 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)' What I'm doing wrong or I must to build framework with lower swift version then app?

Add a Comment

I ended up on this thread while googling an error with a similar message and log.

In my case, I got the error while working on building a library with CocoaPods and the fix was to add XCTest to the list of linked frameworks.

# CombineTestHelpers.podspec

Pod::Spec.new do |s|
  # ...
  s.framework = 'XCTest'
  # ...
end

You can find the full .podspec here.

I'm not sure how relevant this is for this particular issue, but hopefully it can provide some inspiration. 🤞