0

Got this error, when following this solution: https://stackoverflow.com/a/61263653/20051894

'testTarget(name:dependencies:path:exclude:sources:resources:cSettings:cxxSettings:swiftSettings:linkerSettings:)' is unavailable

What is wrong?

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: "IkigaJSON",
            dependencies: [.product(name: "NIO", package: "swift-nio")]),
        .testTarget(
            name: "IkigaJSONTests",
            dependencies: [.target(name: "IkigaJSON")],
            resources: [
                .copy("Resources/test.txt")
            ]
        ),
    ]
)
Alma
  • 31
  • 4
  • Which Xcode / Swift version are you using? – timbre timbre Sep 27 '22 at 15:01
  • XCode Version 13.4.1 swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12) – Alma Sep 27 '22 at 18:45
  • it should be fine then. Try to specify the version of swift tools maybe: `// swift-tools-version:5.6.1`. See https://docs.swift.org/package-manager/PackageDescription/PackageDescription.html – timbre timbre Sep 27 '22 at 21:49

0 Answers0