Xcode not resolving spm dependencies with following error: the package at ‘/’ cannot be accessed (Couldn’t read ‘x.x.x’: fatal: not a tree object)

  Kiến thức lập trình

Xcode is unable to resolve all dependencies added to project through SPM.
One specific spm dependency is causing trouble, so when it is beingf resolved it suddenly stops with error:

 the package at '/' cannot be accessed (Couldn’t read 'x.x.x': fatal: not a tree object)

package cannot be accessed not a tree object

I was finally able to fetch the version of spm I was after.
Difficult to say what made the trick, as the list of things tried has grown

A combination of removing some of:

derived data
clean project
restarted xcode
restarted mac
reset package caches
package.resolved
Xcode Project Build Caches and Indexes
Xcode caches
~/Library/org.swift.swiftpm
~/Library/Caches/org.swift.swiftpm

My guess is my machine was in a weird state in which xcode was told that my som spm was cached
But then it tried to get it and it was not there

LEAVE A COMMENT