BugMedic

Reset Swift package caches in Xcode safely

Use Xcode’s package cache reset only after checking whether the problem is access, version constraints, or a stale checkout. Preserve Package.resolved so you can inspect version changes.

By BugMedic editorial teamLast source review: 2026-09-27macOS

Use Xcode’s package cache reset only after checking whether the problem is access, version constraints, or a stale checkout. Preserve Package.resolved so you can inspect version changes.

Try these fixes in order

01

Record the original failure

Copy the first package resolution error and inspect the affected repository URL and version. A private package authentication failure will recur after clearing a cache.

02

Review the lockfile

Check the project or workspace Package.resolved in source control. Do not delete it automatically; it pins dependency revisions for reproducible builds.

03

Reset through Xcode

Use File > Packages > Reset Package Caches (menu wording can vary by Xcode version), then Resolve Package Versions. This forces Xcode to fetch package data again.

04

Compare the result

Review any Package.resolved changes before committing. If the same URL fails, fix network access, credentials, or an unsatisfiable version requirement.

Interpret what you see

Only one package checkout is stale

What it suggests: Xcode may be using a cached revision that no longer matches the requested version.

Next check: Record the error and pinned revision, reset package caches through Xcode, then resolve and inspect lockfile changes.

The first error is permission denied for a private repository

What it suggests: The cache is not the cause.

Next check: Confirm the selected account or CI runner can fetch the repository before resetting anything.

Version requirements conflict after reset

What it suggests: Fresh package metadata still cannot satisfy the graph.

Next check: Compare each requirement and available tag; change constraints deliberately instead of repeatedly clearing caches.

Why this happens

  • Cached package data or checkout is stale.
  • A real network, authentication, or version constraint error remains after reset.

Still not working?

For a standalone Swift package, use the SwiftPM command line from its package root. Clearing Xcode DerivedData is a separate build-cache operation and should not be the first package-resolution fix.

Official sources

These steps are based on the linked documentation and general diagnostics. BugMedic has not independently tested every product and system configuration. Review commands before running them.

Related Xcode guides