Error: The compiler that produced it 'Apple Swift 5.2.2 (swiftlang...) may have used features that are not supported by this Compiler (Apple Swift 5.3 (swiftlang...)


I have been trying to enable module stability for a framework. I went ahead with enabling the Build Library For Distribution Setting.

I must say that I renamed a class due to having the same name as the Framework itself because I was having a lot of issues at the beginning, apparently because both the framework and a type shared the same name.

Now, I'm compiling the framework using Xcode 11.4.1, I'm able to compile my application in Xcode 11.4.1, using this framework compiled with the same Xcode version, all good there.
The issue is that when I try to archive the app in Xcode 12 beta 6, using the framework compiled with Xcode 11.4.1 I get an error saying:

Failed to build module 'Framework' from its module interface; the compiler that produced it, 'Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3 (swiftlang-1200.0.28.1 clang-1200.0.30.1)'

I also get a lot of errors like:

'MyFramework has been renamed to MyNewFrameworkName'
'SomeClass is not a member type of MyFramework'

Any help, guidance or clarification is really appreciated!! I'm not really sure what I'm doing wrong.

I have this problem too, and it also shows this: the compiler that produced it, 'Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3 (swiftlang-1200.0.28.1 clang-1200.0.30.1)'

1 Like

Did you happen to leave in a

typealias MyFramework = MyNewFrameworkName

for backwards compatibility?

It seems to me like there's still a type called MyFramework in your module, and unfortunately that won't work regardless if it's a typealias or a regular type until is fixed.

Has there been any development on this subject?

Hello everyone, I am sorry for the late follow-up.
@harlanhaskins That was good advice, this was related to something similar.

This turns out that the class that previously shared the same framework name was marked with the @objc attribute and this was using the framework name as an optional identifier, this was causing these compilation issues. For example:

@objc(MyFramework) <- Problematic identifier.
class MyClass {

Since the identifier is optional, I did not have any issues removing this. I hope that this will be useful to others.
As a rule of thumb, this seems this is needed to remove all of the possible occurrences of the respective Framework Name that are in the code.

Terms of Service

Privacy Policy

Cookie Policy