Xcode12 minimum deployment target and SPM

Hello,

Some libraries imported with SPM in Xcode12 have problems with minimum deployment target on iOS (and probably on other platforms). Xcode12 has bumped it to iOS 9, most libraries have it set up as iOS 8.
This results in a warning:
The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99.

The bigger problem arises, when there's a library requiring iOS 8 that depends on a library that does not have any minimum deployment target set:
The package product 'iOSAnyPackage' requires minimum platform version 9.0 for the iOS platform, but this target supports 8.0

I can easily replicate this with a sample project with these local dependencies:
MyProject -> iOS8Package -> iOSAnyPackage

iOS8Package:

let package = Package(
    name: "iOS8Package",
    platforms: [
        .iOS(.v8)
    ],
    (...)
    dependencies: [
        .package(path: "../iOSAnyPackage")
    ],
    targets: [
depends on.
        .target(
            name: "iOS8Package",
            dependencies: ["iOSAnyPackage"]),
        (...)
    ]
)

iOSAnyPackage:

let package = Package(
    name: "iOSAnyPackage",
    products: [
        .library(
            name: "iOSAnyPackage",
            targets: ["iOSAnyPackage"]),
    ],
    dependencies: [
    ],
    targets: [
depends on.
        .target(
            name: "iOSAnyPackage",
            dependencies: []),
        .testTarget(
            name: "iOSAnyPackageTests",
            dependencies: ["iOSAnyPackage"]),
    ]
)

Is there a way to force all dependencies to use iOS 9 as their minimum deployment target?

Examples from GitHub:
https://github.com/SDWebImage/SDWebImageWebPCoder - iOS 8, depends on https://github.com/SDWebImage/libwebp-Xcode that doesn't have any platform specified

1 Like

See the similar discussion at Minimum iOS version, Xcode 12 and build warnings

Thanks, these issues are related, unfortunately, I have errors in addition to warnings.
I created https://bugs.swift.org/browse/SR-13579

1 Like
Terms of Service

Privacy Policy

Cookie Policy