未找到目标 'AAA' 的 SPM 工件 - 仅限 Xcode 13.3

SPM artifact not found for target 'AAA' - Xcode 13.3 only

我有随 SPM 安装的 SDK。它在 Xcode 13.2 中按预期工作,但在 Xcode 13.3 中出现此错误。

import PackageDescription

let package = Package(
name: "AAA",
products: [
    .library(
        name: "AAA",
        targets: ["AAA"]),
],
dependencies: [
    
],
targets: [
    .binaryTarget(
                        name: "AAA",
                        path: "artifacts/BBB.xcframework"
                    ),
    .testTarget(
        name: "AAATests",
        dependencies: ["AAA"]),
]

工件名称必须与目标名称匹配(这是 Xcode 13.3 的新内容)。 由于您的工件名称是 BBB.xcframework,下面的示例应该适合您:

let package = Package(
    name: "BBB",
    products: [
        .library(
            name: "BBB",
            targets: ["BBB"]),
    ],
    dependencies: [
        
    ],
    targets: [
        .binaryTarget(
            name: "BBB",
            path: "artifacts/BBB.xcframework"
        ),
    ]
)

就我而言,解决此问题的唯一方法是从 https://developer.apple.com/download/all/

下载更早的 Xcode 版本 (13.2)