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

I have SDK that installed with SPM. It works as expected from Xcode 13.2 but on Xcode 13.3 I got this error.

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"]),
]

error_image



Solution 1:[1]

The artifact name has to match the target name (This is a new Xcode 13.3 thing). Since your artifact name is BBB.xcframework, the example below should work for you:

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

Solution 2:[2]

In my case, the only way to solve this was by downloading earlier Xcode version (13.2) from https://developer.apple.com/download/all/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 stackich