Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift Package Manager stuck on loading screen forever

SPM loads indefinitely as seen below. I cannot add any packages.

Whether I enter a URL, or don't enter a URL, this screen is loading forever.

Have tried deleting DerivedData folder (~/Library/Developer/Xcode/DerivedData) as well as SPM caches (~/Library/Caches/org.swift.swiftpm/), does not help.

Have made sure that I've committed my code to a git repository, and followed the advice here.

This is the first package I'm adding—I can't add any packages, generally.

This problem exists for all my Xcode projects.

enter image description here

like image 746
Plato Avatar asked Dec 13 '25 01:12

Plato


1 Answers

I faced the same problem in Xcode 16.1. These two solutions worked for me, but I must repeat them every time I add a new Swift package (SPM).

The first way:

  1. When you are on the loading SPM screen, press command + delete/backspace to clear the SPM history.
  2. Clear the history. enter image description here
  3. After that, I can add a new SPM.

The second way:

  1. Close Xcode completely. Ensure it’s not running in the background.
  2. Open the Terminal and run the following command to remove cached Swift Package references: plutil -remove IDESwiftPackageAdditionAssistantRecentlyUsedPackages ~/Library/Preferences/com.apple.dt.Xcode.plist
  3. Reopen Xcode and your project. You should now be able to add a new Swift Package without any issues.
like image 151
Andrew Kolisnyk Avatar answered Dec 15 '25 07:12

Andrew Kolisnyk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!