Mastercard gateway iOS SDK installation using Carthage failed

29 views Asked by At

I am trying to install Mastercard gateway iOS SDK using Carthage.

  1. Success case I created a new project using Xcode 14.2 and my command line tool is also set to 14.2 then I install the SDK using terminal carthage update --use-xcframeworks it works fine by creating Carthage/Build folder. All good
  2. Failure When I try the same using Xcode 14.3 or higher (Also setting command line tool to 14.3 or higher) then carthage update --use-xcframeworks fails and give me path of log file. This log file mentions The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 11.0 to 16.4.99. (in target 'MPGSDK-iOS' from project 'MPGSDK')

I know how to fix this problem for CocoaPods by setting SDKs targets to higher version either in pod file or Xcode. But I need this solution for Carthage.

1

There are 1 answers

0
Rana Ijaz On

Finally I figured it out with following steps:

Download the code from MPGSDK GitHub. Open terminal, 'cd' to inside this project folder. Run following commands to create frameworks on Desktop for Simulator and device and then combine them. (Before running command, open project with Xcode and set minimum target and other settings if needed)

xcodebuild archive \ -scheme MPGSDK-iOS \ -archivePath ~/Desktop/ios-arm64_i386_x86_64-simulator.xcarchive \ -sdk iphonesimulator \ SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES

Set this last parameter BUILD_LIBRARY_FOR_DISTRIBUTION=YES or both in the project settings as well. (Target and project both)

xcodebuild archive \ -scheme MPGSDK-iOS \ -archivePath ~/Desktop/ios-arm64_armv7.xcarchive \ -sdk iphoneos \ SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES

xcodebuild -create-xcframework \ -framework ~/Desktop/ios-arm64_i386_x86_64-simulator.xcarchive/Products/Library/Frameworks/MPGSDK.framework \ -framework ~/Desktop/ios-arm64_armv7.xcarchive/Products/Library/Frameworks/MPGSDK.framework
-output ~/Desktop/MPGSDK.xcframework