Home > Net >  Swift update deployment target to match package requirement
Swift update deployment target to match package requirement

Time:12-06

I'm new to swift development, so excuse the basic question, but when I import a package called SwiftHttp in a local package, I get this error:

Compiling for macOS 10.13, but module 'SwiftHttp' has a minimum deployment target of macOS 10.15:

So I've gone in to my project's setting, and changed the minimum deployments to macOS 11.0, both in the "project" section, and for all targets, but that error remains in the file. Is there anywhere else I need to update that setting? Or is there something I need to do to "propagate" that setting to the local package?

Images of what I have... Project settings: enter image description here

Target settings enter image description here

Error: enter image description here

CodePudding user response:

I managed to fix it by explicitly setting a supported platform version in package.swift in my own package, which I use" in this project. The relevant part now looks like this:

let package = Package(
    name: "Swiftodon",
    platforms: [
            .macOS(.v10_15),
            .iOS(.v13),
            .tvOS(.v13),
            .watchOS(.v6)
        ],
  • Related