Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Swift Package Manager hangs while Xcode resolves packages

Errorswift package resolve does not return

Short answer

When package resolution hangs, first run the same resolve from the terminal so you see real output. Then work through the cache and the lock file: purge SwiftPM's global cache, reset the package's own build directory, and check that Package.resolved matches Package.swift.

  • Applies to Xcode 26, Swift 6.2, macOS 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Run the resolve outside Xcode. The terminal shows which package it is stuck on, which the Xcode status bar does not.

    cd path/to/your/package
    swift package resolve --verbose
  2. 2Match what you see, then jump to its fix

    1. 1The verbose output stops or repeats on the same package.A stale or half-filled package cacheFix
    2. 2Resolution starts only after a pull, a branch switch or a version-rule edit.Package.resolved disagrees with Package.swift or with a teammate's commitFix
    3. 3The terminal resolves fine but the Xcode project still shows packages unresolved.Xcode itself needs to be told to resolve againFix

What does the error look like?

  • swift package resolve does not return
  • Package resolution never finishes in Xcode

Cause 1 of 3

A stale or half-filled package cache

1Check

SwiftPM keeps a global repository cache. Apple and the SwiftPM docs offer two cleaners: purge-cache for the global cache, reset for the package's own cache and build directory.

swift package purge-cache --verbose

2Fix

Purge the global cache, reset the package, then resolve again. Expect the next resolve to download everything again.

swift package purge-cache
swift package reset
swift package resolve

3Verify

resolve exits with no error.

swift package resolve && echo resolved

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 2 of 3

Package.resolved disagrees with Package.swift or with a teammate's commit

1Check

Resolve keeps recorded versions while they stay eligible, and a changed Package.resolved makes the next resolve move dependencies to match it. Look at what changed in the file.

git log -p -n 3 -- Package.resolved

2Fix

Resolve against the recorded versions only, or move everything to the newest eligible versions with update, which also rewrites Package.resolved.

swift package resolve --force-resolved-versions
# or, to take newer eligible versions:
swift package update

3Verify

Package.resolved is stable: a second resolve changes nothing.

swift package resolve
git status --short Package.resolved

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 3 of 3

Xcode itself needs to be told to resolve again

1Check

Xcode updates and resolves packages on its own, and you can trigger both from the File > Packages menu. Xcode's lock file for an app project sits inside the project.

find . -name Package.resolved -not -path './.build/*'

2Fix

In Xcode choose File > Packages and run the resolve action, then update if you want newer versions.

# Xcode menu: File > Packages, then the resolve action
# file used by the project:
# YourApp.xcodeproj/project.workspace/xcshareddata/swiftpm/Package.resolved

3Verify

The Swift Package Dependencies section in the Project navigator lists every package with a version.

ls YourApp.xcodeproj/project.workspace/xcshareddata/swiftpm/

Confirmed by developer.apple.com

Did this fix it?

How do I stop it coming back?

  • Commit Package.resolved so everyone resolves the same versions.
  • Prefer version-based requirements over branch or commit rules.
  • Resolve once in the terminal after changing dependencies, so a network problem shows up as text, not as a spinner.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

InstanceID token() no longer works in a Swift Firebase app

Instance ID calls fail to compile after upgrading Firebase to 8.0.0 or later

Firebase removed the Instance ID dependency from Messaging in 8.0.0, so InstanceID.instanceID() calls no longer belong in a current app.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.