Xcode 16 & Package load failure

I have installed Sequoia and Xcode 16 and now I can't add packages to my (or any project). I just get a message saying the package can't be resolved. Basically I can't carry on developing.

SORT THIS OUT APPLE

Same issue

Accepted Answer

Fixed the problem by completely removing Xcode 16 and reinstalling.

Delete ~/Library/Preferences/com.apple.dt.xcodebuild.plist should fix this. You don't need to uninstall Xcode completely.

didn't work

I was struggling with this error for a whole day, what helped me at the end:

1 - Deleting all spm cache and derived data: rm -rf ~/Library/Caches/org.swift.swiftpm ~/Library/Developer/Xcode/DerivedData ~/Library/org.swift.swiftpm ~/.swiftpm/xcode/

2 - Adding package with "Add Anyway" option

3 - Fully closing Xcode (cmd + q) and running this in project folder: xcodebuild -resolvePackageDependencies -disablePackageRepositoryCache

Hope it helps someone! :)

Wow, it's really painful, everything is not helpful for me. :( maybe I need to re-install Xcode.

xcode 16.1 has the same issue. What is apple doing?

Xcode 16 & 16.1 same issue. Reinstalling and cleaning cache didn't help.

That sounds weird, as git is working correctly.

Xcode 16.1, MacOS Sequoia 15.0.1

I had same issue with Same MacOS Sequoia 15.0.1, Package download with dependency not working after updating MacOS 15.1 it started working

FWIW, quitting Xcode and purging the folders mentioned by @SubvertDev allowed me to resolve the package dependency error.

Im on Xcode 16 on macOS 14.5, and had the error in a fairly large Xcode Project with lots of dependencies.

you can run this each time you need to install a package

plutil -remove IDESwiftPackageAdditionAssistantRecentlyUsedPackages ~/Library/Preferences/com.apple.dt.Xcode.plist

I've also encountered some weird issues with resolving packages all of a sudden. Turned out I had this section in my ~/.gitconfig file

[safe]
	bareRepository = explicit

Changing explicit toall fixed the issue for me. This is a potential security risk but that line was not there before and the default value is all.

This section was not present 10 days ago. In the meantime, I've upgraded macOS from 15.0 to 15.1 but I've also upgraded quite a few brew formulae. I'm doubting any of this would change the .gitconfig file but have no explanation so far.

Anyway, if you're having issues with package resolution, check if you've got that git configuration set.

Check if if you don't need to agree to the updated license agreement on developer.apple.com - fix me the problem with both Xcode 16 and 16.1.

Fixed the issue by opening Keychain Access, searching & removing all github entries (or updating them). For some reason xcode 16.x preferes keychain passords over its own settings.

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 command + delete/backspace to clear the SPM history.
  2. Clear the history. [enter image description here][1]
  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.

I've started facing this issue when upgraded my system from macOS 14 (Sonoma) to macOS 15 (Sequoia) along with Xcode update from 16.1 to 16.2. I've tried all the above methods and nothing works me. What works for me was the following:

  1. Removed all Swift Package dependencies.
  2. Cleaned the build folder.
  3. Started building the project again.
  4. Added each package dependency one by one as the build process prompting the missing package error.

Met similar issue with Xcode16.2 Tried the handcraft methods in the threads, 'swift package resolve', downgrading to Xcode15.4

Finally, it works after I switch to another WiFi...

Hope this help

Same issue here. Large project, lots of dependencies.

XCODE fails.

Likely a good idea to raise an issue now with Feedback Assistant.

This is 20 years of Xcode and still can't do basic dependency management. :)

I used the Clear History from the SPM screen and then closed the SPM panel and reopened it and suddenly it was working again !

None of the solutions outlined here worked for me. The only way I got it to work was closing Xcode, deleting all the caches, then when adding my package: instead of choosing "Up to Next Major Version" as the dependency rule, I chose "Exact Version" and typed in the latest version number.

After that I could navigate to my top-level project, then on the "Package Dependencies" tab, change it to "Up to Next Major Version". That seems to work, at least for now.

For some people it might be worth checking your Package.resolved file to see whether it got corrupted or simply rolling it back to a previous version.

Swift Package manager was acting up for me for one specific project. Wouldn't add new packages, would not resolve existing packages, etc. It worked fine for other projects. I then took a look at the Package.resolved file and there seemed to be a merge conflict that wasn't pointed out by the repository tools. SPM started working as expected after resolving the conflicts.

Xcode 16 & Package load failure
 
 
Q