Swift Package Manager "failed to resolve dependencies" in CI
By Daniel Zoghalchali·Latchkey
SwiftPM could not find a set of package versions that satisfies every requirement in Package.swift. Two dependencies pin incompatible ranges of a shared package, or a required tag does not exist.
What this error means
swift package resolve (or a build that resolves first) fails with "failed to resolve dependencies", naming the conflicting requirements. It is deterministic and reproduces with the same Package.swift/Package.resolved.
swift package output
error: failed to resolve dependencies:
Dependencies could not be resolved because root depends on 'swift-log' 1.5.0..<2.0.0
and 'metrics-kit' 0.3.0 depends on 'swift-log' 1.0.0..<1.4.0.
Diagnose it: SDK, signing, or simulator?
Mobile CI failures cluster into three: a missing or mismatched SDK component, a code-signing identity that does not exist on the runner, or a simulator or emulator that never became ready.
Terminal
# Android
sdkmanager --list_installed 2>/dev/null | head
echo "ANDROID_HOME=$ANDROID_HOME"
adb devices
# iOS
xcodebuild -version && xcrun simctl list devices available | head
security find-identity -v -p codesigning
Common causes
Incompatible version ranges
Two dependencies require non-overlapping versions of a shared package. SwiftPM will not pick one arbitrarily - it reports the conflict.
A missing or moved tag
A dependency pinned .exact() to a tag that was deleted or never published cannot be resolved anywhere SwiftPM looks.
How to fix it
Read the conflict and relax a range
Identify the shared package and the two conflicting requirements in the message.
Loosen your own .upToNextMajor/.exact requirement so the ranges overlap.
If two third-party packages conflict, upgrade the lagging one to a release that accepts the newer shared dependency.
Re-resolve verbosely
Resolve on its own with verbose output to see the full constraint graph.
Terminal
swift package resolve --verbose
swift package show-dependencies
How to prevent it
Use version ranges rather than .exact() pins where possible.
Commit Package.resolved so resolution is reproducible.
Upgrade related packages together to keep shared deps compatible.
Frequently asked questions
What causes Swift package manager "failed to resolve dependencies" in CI?
There are 2 common causes: incompatible version ranges and a missing or moved tag. Two dependencies require non-overlapping versions of a shared package.
How do I fix Swift package manager "failed to resolve dependencies" in CI?
There are 2 fixes depending on which cause you have: read the conflict and relax a range and re-resolve verbosely. Work through them in order, since the first is the most common.
What does Swift package manager "failed to resolve dependencies" in CI actually mean?
swift package resolve (or a build that resolves first) fails with "failed to resolve dependencies", naming the conflicting requirements.
How do I stop Swift package manager "failed to resolve dependencies" in CI happening again?
Use version ranges rather than .exact() pins where possible. The prevention section lists 3 changes that keep it from recurring.