xCode SPM多个目标已命名

t9aqgxwy  于 2023-01-31  发布在  其他
关注(0)|答案(1)|浏览(182)

在我的项目中,我有两个依赖项

.package(name: "Web3swift", url: "https://github.com/skywinder/web3swift.git", from: "3.0.6"),
.package(name: "Random", url: "https://github.com/vapor-community/random.git", .upToNextMinor(from: "1.2.0"))

随机包也有Core依赖项(https://github.com/vapor/core.git),目标包名称Web3swift也有Core

let package = Package(
    name: "Web3swift",
    platforms: [
        .macOS(.v10_15), .iOS(.v13)
    ],
    products: [
        .library(name: "web3swift", targets: ["web3swift"])
    ],
    dependencies: [
        .package(url: "https://github.com/attaswift/BigInt.git", .upToNextMinor(from: "5.3.0")),
        .package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMinor(from: "1.5.1"))
    ],
    targets: [
        .target(name: "secp256k1"),
        .target(
            name: "Core",
            dependencies: ["BigInt", "secp256k1", "CryptoSwift"]
        ),
        .target(
            name: "web3swift",
            dependencies: ["Core", "BigInt", "secp256k1"],
            exclude: excludeFiles,
            resources: [
                .copy("./Browser/browser.js"),
                .copy("./Browser/browser.min.js"),
                .copy("./Browser/wk.bridge.min.js")
            ]
        ),

现在我有个问题:

multiple targets named 'Core' in: 'core', 'web3swift'; consider using the `moduleAliases` parameter in manifest to provide unique names

你能解释一下怎么修吗?

nkoocmlb

nkoocmlb1#

查看developer documentation时,您会注意到只有Swift 5.7+支持此功能。要修复“...is unavailable”消息,您需要将Package.swift中的标头更新为:// swift-tools-version:5.7(也要求XCode〉14)。
如需完整详细信息,请参阅:
1.雨燕5.7
1.演变建议:SE-0339
AFAICT,您的更改看起来正确。

相关问题