Shopify / mobile-buy-sdk-ios

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.
MIT License
452 stars 199 forks source link

Module compiled with Swift 5.2.4 cannot be imported by the Swift 5.3 compiler on Xcode 12 #1106

Closed das-palash-appsbee closed 4 years ago

das-palash-appsbee commented 4 years ago

Description

Previously I was using Xcode 11.6 to build these frameworks using Carthage. Now I upgraded Xcode to 12 and after building these frameworks when I integrate into my project and tried to run, it shows an error like:

Module compiled with Swift 5.2.4 cannot be imported by the Swift 5.3 compiler

Steps to Reproduce

  1. update your Xcode version to 12.0
  2. Build framework using Carthage carthage update --platform iOS (version 5.0.0)
  3. Add Buy.framework and Pay.framework into any project
  4. Run the project

Actual Error:

/Users/John/Desktop/Shopify Demo/API/ClientQuery.swift:4:8: Module compiled with Swift 5.2.4 cannot be imported by the Swift 5.3 compiler: /Users/John/Desktop/Shopify Demo/Shopify Demo/Buy.framework/Modules/Buy.swiftmodule/x86_64-apple-ios-simulator.swiftmodule

Workarounds I tried:

  1. So few workarounds like this where you need to set the Build Libraries for Distribution option to Yes in your framework's build settings, otherwise the swift compiler doesn't generate the neccessary .swiftinterface files which are the key to future compilers being able to load your old library. But it didn't solve the issue.
  2. Next I tried this Carthage workaround where you need to tweak the EXCLUDED_ARCHS statement. But it also failed.

Versions

  1. Xcode v 12.0 (12A7209)
  2. Carthage v 0.36.0
  3. Shopify mobile-buy-sdk-ios v 5.0.0
SocialKitLtd commented 4 years ago

Same issue here

SatishMavani commented 4 years ago

Same Issue

uncleRX commented 4 years ago

Same Issue

Imanmf commented 4 years ago

same issue

anama777 commented 4 years ago

Same issue

vixdug commented 4 years ago

Thanks for the feedback. We are looking into this - no more reports needed at this time.

dbart01 commented 4 years ago

This is now fixed in v5.1.0! We also recommend to use Swift Package Manager for managing this dependency.

DanGDroid commented 3 years ago

try deleting Derived Data and build again

newtest-cjt commented 3 years ago

same question

Imanmf commented 3 years ago

I had this issue and some issue more. So I decide to migrate to cocoapod. I am using cocoapod now and I have not any problem. I suggest you to migrate to cocoa pod guys

dbart01 commented 3 years ago

Use SPM instead.

bunyod0210 commented 3 years ago

try deleting Derived Data and build again

this helped me in Xcode 12 thanks

Ganux1 commented 3 years ago

Came across this one: https://github.com/Alamofire/Alamofire/issues/3280

Thought it could be helpful for someone...