SwiftPM "the resolved file is out of date" in CI
SwiftPM compared Package.resolved against the current Package.swift requirements and found they disagree. In a frozen or verified resolve, it refuses to silently update and reports the file is out of date.
What this error means
A resolve run with --disable-automatic-resolution (or Xcode's verified mode) fails with "the resolved file is out of date" or "an out-of-date resolved file was detected".
error: an out-of-date resolved file was detected at Package.resolved, which is not allowed when automatic dependency resolution is disabled; please make sure to update the file to reflect the changes in dependenciesCommon causes
Package.swift changed without relocking
You edited a dependency requirement in Package.swift but did not regenerate Package.resolved, so the pins no longer match.
CI resolves in frozen mode on a drifted lock
A frozen resolve is meant to fail rather than change pins, surfacing the drift instead of silently updating.
How to fix it
Regenerate and commit Package.resolved
- Run
swift package resolve(or update) to refresh the pins. - Commit the updated
Package.resolvedalongside the manifest change. - Re-run CI so the frozen resolve matches.
swift package resolve
git add Package.resolvedGate lock freshness in CI
Fail fast when the lock drifts so the resolved file is always committed with the manifest edit.
swift package resolve --disable-automatic-resolutionHow to prevent it
- Run
swift package resolvewhenever you change a dependency requirement. - Commit
Package.resolvedin the same change as the manifest edit. - Use
--disable-automatic-resolutionin CI to catch drift early.