Xcode throws error 'Module compiled with Swift 5.1.1 cannot be imported by the Swift 5.2 compiler'

102 views Asked by At

I am trying to fix this error I'm getting. The project uses Swift Dependency Management along with Carthage. When I try to build with Xcode 11 I get this error, I've tried various other versions however I'm still unable to build successfully.

I'm not sure if I'm using the wrong version of XCode. I'm also not sure about Carthage as I've only ever previously used Cocoapods. Any help would be appreciated.

I've tried quite a few of the solutions mentioned here on SO but no luck :/

Is there supposed to be a workspace file produced like Cocoapods? I don't see one.

1

There are 1 answers

1
Helge Becker On

Likely cathage is building with the wrong toolchain. Had that once when homebrew trying to build a outdated project.

Check if xcode-select -p shows the correct toolchain. You can set the correct toolchain with sudo xcode-select -s