skip to Main Content

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

enter image description here

enter image description here

enter image description here

2

Answers


  1. I was getting exactly that same problem. Updating to Sonoma 14.4 MacOS, and Xcode 15.3 got rid of the problem.

    Login or Signup to reply.
  2. 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 chose

    It 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:

    let package = Package(
      name: "GoogleUserMessagingPlatform",
      platforms: [.iOS(.v11)],
      products: [
        .library(
          name: "GoogleUserMessagingPlatform",
          targets: ["UserMessagingPlatform"]
        )
      ],
      targets: [
        .binaryTarget(
          name: "UserMessagingPlatform",
          url:
            "https://dl.google.com/googleadmobadssdk/f0f50864216a2469/googleusermessagingplatformios-spm-2.1.0.zip",
          checksum: "f0f50864216a24690725f246df0b289d2eb6cc699b9da476857a0c135aeced84"
        )
      ]
    )
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search