Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ios

swift

paytm

I am trying to implement integration of third party app into project as per instruciton https://github.com/Paytm-Payments/Paytm_iOS_App_Kit/tree/master/Swift/BitCodeDisabled/PaytmNativeSDK

I see the following error in build

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

I have tried toolchains https://medium.com/xcblog/switching-swift-versions-inside-xcode-using-toolchains-755b28831c43 The error changes to Reason: Incompatible library version: PaytmNativeSDK requires version 1.0.0 or later, but libswiftCore.dylib provides version 0.0.0

How do i setup XCode or the Library to make it work . There is no chance of the vendor updating the library for Swift 5.0 and make it available on POD.

like image 403
appbootup Avatar asked Mar 26 '19 08:03

appbootup


People also ask

How do I upgrade my version of swift?

You can also update every single Swift Package in your project at once. To do this, open the Files menu, navigate to Packages and then click Update to Latest Package Versions. Afterwards, make sure to test your project to see if everything still works, especially in projects with a lot of package dependencies.

What is my swift version?

Click on your project's .Choose Build Settings. Search for “Swift language version” using the search bar. See the Swift version used by this project.

How do I compile framework in Xcode?

In Xcode, select File ▸ New ▸ Project…. Then choose iOS ▸ Framework & Library ▸ Framework. Click Next.


1 Answers

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 
like image 196
Mike Taverne Avatar answered Sep 29 '22 03:09

Mike Taverne