Reputation: 2708
I've searched Apple's documentation, open source projects, and Google, and I cannot seem to find any information about SwiftPM.SPMRepositoryError error 5
. Heck, I can't even find information about SwiftPM.SPMRepositoryError
.
Does anyone know of documentation for this error or the error codes?
Upvotes: 15
Views: 6057
Reputation: 341
What worked for me was switching to ED25519
key.
I think this is happening now because of the effort to improve Git protocol security on GitHub. You can read more about it here: https://github.blog/2021-09-01-improving-git-protocol-security-github/
There you can see the timeline. The final step was put into motion on Mar 15, 2022 (coincidentally that was just two days before your question)
Changes made permanent.
We’ll permanently stop accepting DSA keys. RSA keys uploaded after the cut-off point above will work only with SHA-2 signatures (but again, RSA keys uploaded before this date will continue to work with SHA-1). The deprecated MACs, ciphers, and unencrypted Git protocol will be permanently disabled.
Upvotes: 16
Reputation: 1787
This seems to be the same issue as Error while fetching remote [email protected]:***/***.git: An unknown error occurred. reference 'refs/remotes/origin/master' not found (-1)
in Xcode 14.
Here is a small script I made to work around it: https://stackoverflow.com/a/74130700/624854.
Upvotes: 0
Reputation: 3307
This happened to me on Xcode 13.3 and 13.3.1 when my team added package dependencies that I didn't have Github access to. The error message is ambiguous and shows the same number of errors as the number of packages I have in my dependency tree. But, obtaining access to any repos that I didn't already have access to (which was a smaller number of repos than the error count) resolved the error for me.
I was able to track down the issue by attempting to add another package (anything public like swift-algorithms). Xcode gave me better error reporting in that process.
Upvotes: 2
Reputation: 18909
This helped in my case:
File
-> Packages
-> Reset Package Caches
File
-> Packages
-> Update to Latest Package Versions
Upvotes: 12
Reputation: 11
Updating swift-tools-version
in Package.swift
file worked for me. We've previously been using 5.3, and updating it to 5.5 or 5.6 resolved the problem.
One thing to keep in mind, Apple has deprecated the existing package declaration functions in Swift 5.6 [1], so using this version would result in a lot of new warnings.
Hopefully, this is just a temporary thing, and a proper fix is coming in the next Xcode version.
Upvotes: 1
Reputation: 103
Just had the same issue.. (project based on a Package.swift file, not a regular .xcodeproj)
Doubted that it would have to do something with GitHub's policy as described above, since I've worked on other projects today without any issues.
Tried to clear the derived data folder, as well as the project's .swiftpm
folder and even the swiftpm repo cache.. nothing helped.
Tried the same project on another MacBook and worked fine! Then made a fresh clone of the project in a different folder on the Mac with the issue and worked fine as well.
So finally I just deleted the local Package.resolved
file, reopened the project in Xcode and everything was back to normal 👍🏻
Upvotes: 0