Xcode SPM (Swift Package Manager) Error

Xcode SPM (Swift Package Manager) Error

I added the "Apple App Store Server Swift Library" library to Xcode using Swift Package Manager.

Both the project and target are set to iOS 14 or higher.

However, when I build after adding the library, an error occurs with the library.

A message appears stating that the target is set to iOS 12.

I'm using Xcode 26.0.1.

Even after adding it to all my projects, the build continues with the same error.

I've tried building the library from version 1.0.0 to the latest version, but the same error persists.

Even after completely cleaning the project and running it, the same error persists.

Does anyone know how to fix this?

Answered by DTS Engineer in 864415022

I’m confused. You wrote this:

Both the project and target are set to iOS 14 or higher.

also this:

I'm using Xcode 26.0.1.

The minimum deployment target for Xcode 26 is iOS 15. See the table in Developer > Support > Xcode.

So, given that reality, I did the following:

  1. I used Xcode 26.0.1 to create a new project from the iOS > App template.
  2. I set the deployment target to iOS 15.
  3. I added the Apple App Store Server Swift Library package to my project.
  4. I tried to build it.

That fails with various availability problems. They are all in the Apple App Store Server Swift Library package itself. Its deployment target is set to iOS 13:

let package = Package(
    name: "AppStoreServerLibrary",
    platforms: [
        …
        .iOS(.v13),
        …
    ],
    …
}

but it’s using APIs that were introduced in iOS 14.

To investigate further I cloned the package’s repository directly and then try to build it for iOS. And the results were actually worse! This tries to build the main branch, and on the main branch the platforms array looks like this:

let package = Package(
    name: "AppStoreServerLibrary",
    platforms: [
        .macOS(.v13), // And other server environments
    ],
    ;
}

This causes Swift Package Manager to default to iOS 12, which is a step backwards.

It’s clear that the Apple App Store Server Swift Library package isn’t really set up to be built for iOS. That kinda make sense to me, because it’s very much a server-side package. Using it on iOS is a bit weird.

Anyway, I think this is something you should take up via the support channel for that package. DevForums is primarily focused on Apple APIs and tools. In situations like these, where you’re working with an open source project, we recommend that you seek help via that project’s support channel. And that’s true even in situation’s like this, where the open source project is from Apple.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I’m confused. You wrote this:

Both the project and target are set to iOS 14 or higher.

also this:

I'm using Xcode 26.0.1.

The minimum deployment target for Xcode 26 is iOS 15. See the table in Developer > Support > Xcode.

So, given that reality, I did the following:

  1. I used Xcode 26.0.1 to create a new project from the iOS > App template.
  2. I set the deployment target to iOS 15.
  3. I added the Apple App Store Server Swift Library package to my project.
  4. I tried to build it.

That fails with various availability problems. They are all in the Apple App Store Server Swift Library package itself. Its deployment target is set to iOS 13:

let package = Package(
    name: "AppStoreServerLibrary",
    platforms: [
        …
        .iOS(.v13),
        …
    ],
    …
}

but it’s using APIs that were introduced in iOS 14.

To investigate further I cloned the package’s repository directly and then try to build it for iOS. And the results were actually worse! This tries to build the main branch, and on the main branch the platforms array looks like this:

let package = Package(
    name: "AppStoreServerLibrary",
    platforms: [
        .macOS(.v13), // And other server environments
    ],
    ;
}

This causes Swift Package Manager to default to iOS 12, which is a step backwards.

It’s clear that the Apple App Store Server Swift Library package isn’t really set up to be built for iOS. That kinda make sense to me, because it’s very much a server-side package. Using it on iOS is a bit weird.

Anyway, I think this is something you should take up via the support channel for that package. DevForums is primarily focused on Apple APIs and tools. In situations like these, where you’re working with an open source project, we recommend that you seek help via that project’s support channel. And that’s true even in situation’s like this, where the open source project is from Apple.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Xcode SPM (Swift Package Manager) Error
 
 
Q