Skip to content
Latchkey

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".

swift
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 dependencies

Common 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

  1. Run swift package resolve (or update) to refresh the pins.
  2. Commit the updated Package.resolved alongside the manifest change.
  3. Re-run CI so the frozen resolve matches.
Terminal
swift package resolve
git add Package.resolved

Gate lock freshness in CI

Fail fast when the lock drifts so the resolved file is always committed with the manifest edit.

Terminal
swift package resolve --disable-automatic-resolution

How to prevent it

  • Run swift package resolve whenever you change a dependency requirement.
  • Commit Package.resolved in the same change as the manifest edit.
  • Use --disable-automatic-resolution in CI to catch drift early.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →