I am using Xcode 14.0.1.
I added GoogleAds package with SPM. I go this error.
Error:
Showing Recent Messages
The package product ‘GoogleUserMessagingPlatform’ requires minimum platform version 12.0 for the iOS platform, but this target supports 11.0
How can I fix this ? Minimum Deployment Target: iOS 16
2
Answers
I was getting exactly that same problem. Updating to Sonoma 14.4 MacOS, and Xcode 15.3 got rid of the problem.
I solved this issue by using User Messaging Platform SDK version 2.1.0 instead of the default version 2.4.0.
just add
https://github.com/googleads/swift-package-manager-google-user-messaging-platform.git
package like normal in xcode, but select Version 2.1.0 and Exact. If you already have GoogleUserMessagingPlatform as a depedency is just overrides it with the version you choseIt has nothing to do with your minimum deployment target.
the swift package manager docs say this:
By default, the Swift Package Manager assigns a predefined minimum deployment version for each supported platforms unless you configure supported platforms using the platforms API. This predefined deployment version is the oldest deployment target version that the installed SDK supports for a given platform
https://docs.swift.org/package-manager/PackageDescription/PackageDescription.html
In my case, I’m using Xcode 14.2 which base SDK supports down to ios 11.0 which is lower than the minimum version of 12.0 set in the swift package. Your package should look like this: