Swift SPM软件包的最低iOS版本无法传播

问题描述

我正在创建一个简单的Library Swift Package:

import PackageDescription

let package = Package(
    name: "dpo-sdk-spm",platforms: [
        .iOS(.v10),],products: [
        // Products define the executables and libraries produced by a package,and make them visible to other packages.
        .library(
            name: "dpo-sdk-spm",targets: ["dpo-sdk-spm"]),dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */,from: "1.0.0"),.package(url: "https://github.com/Alamofire/Alamofire.git",.upToNextMajor(from: "5.2.0"))
    ],targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package,and on products in packages which this package depends on.
        .target(
            name: "dpo-sdk-spm",dependencies: ["Alamofire"]),.testTarget(
            name: "dpo-sdk-spmTests",dependencies: ["dpo-sdk-spm"]),]
)

我特别没有创建项目文件,因为在源代码管理中使用它很麻烦-它不需要开发将在iOS App中使用,具有必要的构建设置等的库。库是使用swift package init --type library创建的,结构如下:

enter image description here

我在platforms节点iOS V10下指定,然后将软件包推送到我的git repo中。我将我的git帐户添加到Xcode,创建了一个App项目,通过Scode内置的Xcode 11添加了我的包,没有问题,但是尝试构建时得到了:

Showing All Messages The package product 'Alamofire' requires minimum platform version 10.0 for the iOS platform,but this target supports 8.0

enter image description here

我确实在Package.swift中指定了平台和版本,为什么构建管道会忽略此变量?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)