Compiling for iOS 11.0, but module has a minimum deployment target of iOS 13.0

Viewed 1641

I'm developing a project that supports iOS 11 and newer and faced up with next issue:

Compiling for iOS 11.0, but module 'AWSPredictionsPlugin' has a minimum deployment target of iOS 13.0: /Users/kostyagolenkov/Library/Developer/Xcode/DerivedData/CompilationProblem-btkpsidvptzlicfucdvwpzwadnws/Build/Products/Debug-iphonesimulator/AWSPredictionsPlugin/AWSPredictionsPlugin.framework/Modules/AWSPredictionsPlugin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule

I'd like to use this sdk and provide to users new features with iOS 13 or newer on the board. But don't want to lose users who still use iOS 11 and iOS 12

Question is:

Is it possible somehow to escape import AWSPredictionsPlugin and code that uses the sdk during compilation?

As you can see I added @available(iOS 13, *) for the method configureAmplify(). It works for method. But I did not find any solution for import module part.

I've tried #if canImport(AWSPredictionsPlugin) it did not help.

Here is demo project with reproducible issue

Issue

2 Answers

Go to your project target -> target name -> general -> On Deployment info tab you will see iOS Version -> Select 13.0 to match your project with you framework

enter image description here

You need to update your build settings on the Target -> The AWS plugin is set to build at the 13.0 and your target is set to 11.0 -> to Fix select the Target (Should be in the list of targets after selection the blue icon nect to app name at the very top of the Project navigator files) you are on and navigate to Build Settings -> IOS Deployment target -> Change that to 13.0-> Hope this helps.

Related