I have an app largely built from CocoaPods (some internal, some external), but in a move to modularise and modernise it, new code is being written in SPM packages. Those packages have dependencies of their own.
As soon as I pin the host app to a tagged version (0.0.2 .. Next Minor
) of our internal library, I get errors that I can't explain:
Failed to resolve dependencies
Dependencies could not be resolved because root depends on '{ourLibrary}' 0.0.2..<0.1.0.
'{ourLibrary}' >= 0.0.2 cannot be used because ...
no versions of '{ourLibrary}' match the requirement 0.0.3..<0.1.0
and package '{ourLibrary}' is required using a stable-version
but '{ourLibrary}' depends on an unstable-version package 'iglistkit'.
Two sources of confusion:
The error seems to be saying "you can't have version
0.0.2
because there is no version0.0.3
". Maybe this is a bug in the formatting of the message.The IGListKit version is "unstable". That project hasn't produced a tagged release for 3+ years so
ourLibrary
is asking for a version pinned to a specific commit, which is surely the most stable a version can be.In
ourLibrary
'sPackage.swift
:.package(url: "https://github.com/Instagram/IGListKit", revision: "501cccc6f03"),
ourLibary
is fetched from a git@github.com
URL, which can apparently cause other package resolution problems. Maybe this is another one?