20

While updating packages in XCode 13.3, I get SwiftPM.SPMRepositoryError error 3 and no further details. What is the meaning of this error? How to fix it?

I removed all packages and added them back one by one. But it doesn't seem to be triggered by any specific package. It seems to be triggered by any package.

user7241278
  • 200
  • 1
  • 5

2 Answers2

40

Right click the "Package Dependencies" in the project navigator, then select "Reset Package Caches" will fix this.
This problem happens because you probably cleaned some Xcode cache, and SPM caches got corrupted.

Wode Liu
  • 436
  • 3
  • 6
12

I had this problem and had to do a few things:

  • Update some of the swift packages to later versions that support the new format of SPM package file that is used by Xcode 13.3 (*)
  • Quit Xcode
  • rm -rf ~/Libray/Developer/Xcode/DerivedData
  • rm -rf ~/Library/Caches/org.swift.swiftpm
  • Start Xcode
  • File->Packages->Reset Package Caches
  • Build (could take a while depending on how many packages you have)

This fixed it for me

(*) I had to update Auth0.swift to 2.0, AlamoFire to 5.5.0, and ZenDesk to 5.4.1

Brett
  • 1,647
  • 16
  • 34
  • 1
    This worked for me, thanks! Only difference was I had to right click on Package Dependencies --> Reset Package Caches in Xcode 14 since the File menu has changed. – nhiddink Sep 09 '22 at 20:02