swiftpm use binaryTarget got an error 'no such module' when archive

361 views Asked by At

I'm trying to refactor the project using swiftpm and everything works fine, both in the emulator and on my iPhone device. But when I archive the project, I get an error 'no such module 'SFS2XAPIIOS''.

enter image description here

Here's the code of my Package.swift:

// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "BaseIM",
    platforms: [
        .iOS(.v11)
    ],
    products: [
        .library(name: "BaseIM", targets: ["BaseIM"]),
        .library(name: "SFS2XAPIIOSX", targets: ["SFS2XAPIIOS"])
    ],
    dependencies: [
        .package(name: "BaseTools", url: "http://192.168.1.28:8888/kevin/basetools.git", .branch("master")),
        .package(name: "BaseClass", url: "http://192.168.1.28:8888/kevin/baseclass.git", .branch("master")),
        .package(name: "MediaKit", url: "http://192.168.1.28:8888/kevin/mediakit.git", .branch("master")),
        
        .package(name: "Realm", url: "https://github.com/realm/realm-cocoa", .upToNextMajor(from: "10.1.4"))
    ],
    targets: [
        .target(
            name: "BaseIM",
            dependencies: [
                "SFS2XAPIIOSX", "BaseTools", "BaseClass", "MediaKit",
                .product(name: "RealmSwift", package: "Realm")
            ]
        ),
        .target(
            name: "SFS2XAPIIOSX",
            dependencies: [
                "SFS2XAPIIOS"
            ],
            path: "SFS2XAPIIOS",
            cSettings: [
                .headerSearchPath("Header.h")
            ]
        ),
        .binaryTarget(name: "SFS2XAPIIOS", path: "SFS2XAPIIOS/SFS2XAPIIOS.xcframework"),
        .testTarget(
            name: "BaseIMTests",
            dependencies: ["BaseIM"]),
    ]
)

enter image description here

0

There are 0 answers