swift-collections icon indicating copy to clipboard operation
swift-collections copied to clipboard

Failed to resolve dependencies Dependencies could not be resolved because no versions

Open diuming opened this issue 2 years ago • 1 comments

My Xcode version 14.3.1 Swift version 5.8.1 Package.swift

// swift-tools-version: 5.8
.
.
.
dependencies: [
    .package(url: "https://github.com/apple/swift-collections.git", .upToNextMinor(from: "1.1.0"))
]
.
.
targets: [
        .target(
            name: "MyProject",
            dependencies: [.product(name: "Collections", package: "swift-collections")]
        )
]
.

Showing Recent Messages Failed to resolve dependencies Dependencies could not be resolved because no versions of 'swift-collections' match the requirement 1.1.0..<1.2.0 and root depends on 'swift-collections' 1.1.0..<1.2.0.

diuming avatar Sep 07 '23 01:09 diuming

We do not have a 1.1.0 release tagged yet; the repository's current default branch is downstream from the 1.1 release branch, so the README is documenting a setup that isn't live yet.

To use Swift Collections as a dependency, you need to set your expected version number to one of the existing release tags, as in .upToNextMinor(from: "1.0.5").

(To test unreleased features, you can also use a branch-based spec such as .branch("release/1.1"), or .branch("main") -- however, such specifications should never be used in production, as these development branches are, by definition, unstable: things can arbitrarily change, break or get removed from these branches, without notice.)

I'll see if I can switch the default branch to release/1.0. Failing that, it'd likely be best to change the README on main back to recommend the 1.0 versions.

lorentey avatar Oct 04 '23 04:10 lorentey