Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode suddenly can not get Swift package revision: "Couldn't get revision"

I opened a project in Xcode that relies on RxSwift which is included as a Swift package through the builtin Swift package manager. It worked fine a couple of week ago when I created the project.

Now all of a sudden, when trying to build and run my project, I get an error message about that Swift package:

Couldn’t get revision ‘6.5.0^{commit}’

I tried a clean of the build folder, but would still get the same error.

My internet connection is working fine, so it's not a network issue.

I am also surprised that Xcode would try to get the revision again since no update of the package in question, RxSwift was released between the time building last worked fine and today. So I would assume that whatever is cached locally should still be there and functional.

So far I could not find any other reports about this error message.

like image 814
Raphael Avatar asked Sep 13 '25 00:09

Raphael


2 Answers

Apparently, something was wrong with the package cache.

An update of Xcode or a cleaning tool I run on my Mac which deletes some caches might have confused Xcode's package cache.

In Xcode, click File > Packages -> Reset Package Caches from the menu and then build again.
If that does not do it, first try to restart Xcode and then also try cleaning the build folder as well and try again.

like image 52
Raphael Avatar answered Sep 14 '25 20:09

Raphael


If this issue persists after resetting package caches.

Run the following commands

rm -rf ~/Library/Caches/org.swift.swiftpm
rm -rf ~/Library/org.swift.swiftpm
like image 32
Paul Nyondo Avatar answered Sep 14 '25 20:09

Paul Nyondo