Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.0 compiler

For Carthage users: After upgrading to Xcode 10.2, I ran into this same issue with a framework that I had been importing using Carthage.

I resolved it by rebuilding the framework:

carthage update --no-use-binaries --platform iOS

The correct solution is download Xcode 10.1, and wait for Apple patch the bug fix.

Don't waste time on fix third-party bug.


The problem of my project is we are using Alamofire which is failed to update by Carthage.


The provider of this library should rebuild it with BUILD_LIBRARY_FOR_DISTRIBUTION = YES; (available in Xcode 11.3 in Build Settings -> Build Options). Already asked to do it in the corresponding GitHub issue. After that PaytmNativeSDK will be compatible with every next Swift version.

It looks like the issue has been fixed in 804152caae76245d96548eb74ea87a6150239407.

Tags:

Ios

Swift

Paytm