[SOLVED] Package resolution failed. Couldn’t get the list of tags

Issue

This Content is from Stack Overflow. Question asked by Joseph.Ching

I can’t add any swift packages using SPM. this includes any of the Apple Swift packages, or any other packages from github.

For example, attempts to add the swift-collections package (using File > Add Packages…) shows the following prompt:

Package Resolution Failed
swift-collections could not be resolved.
Fetching from https://github.com/apple/swift-collections.git (cached)
Cloning local copy
Checking out 1.0.3
Couldn't update repository submodules:

Image of prompt

If I choose “Add Anyway”, the project can still build successfully if I don’t import the module. The package dependency is listed in the .xcodeproj file.
However, importing the module will not work (No such module ‘Collections’).

The following un-categorized buildtime issue is consistent no matter what package I try to add:

Couldn't update repository submodules:

/Users/username/Downloads/Xcode.app/Contents/Developer/usr/libexec/git-core/git-submodule: line 7: basename: command not found
/Users/username/Downloads/Xcode.app/Contents/Developer/usr/libexec/git-core/git-submodule: line 7: sed: command not found
/Users/username/Downloads/Xcode.app/Contents/Developer/usr/libexec/git-core/git-sh-setup: line 86: basename: command not found
/Users/username/Downloads/Xcode.app/Contents/Developer/usr/libexec/git-core/git-sh-setup: line 86: sed: command not found
/Users/username/Downloads/Xcode.app/Contents/Developer/usr/libexec/git-core/git-sh-setup: line 333: uname: command not found
/Users/username/Downloads/Xcode.app/Contents/Developer/usr/libexec/git-core/git-submodule: line 954: sed: command not found
/Users/username/Downloads/Xcode.app/Contents/Developer/usr/libexec/git-core/git-submodule: line 954: cmd_: command not found

I’m not sure what this means, because all of the commands above (basename, sed, uname) seem to work in the terminal.

I’ve tried Xcode 13.4.1,Xcode 14.0, Xcode 14.0.1, which all have the same issue.

I have also reset my ~/.gitconfig to default and reinstalled Xcode command line tools.

And I have tried the solution to a similar but seemingly unrelated problem:

git config --global tag.forcesignannotated false

I tried using all 4 different dependency rules while adding the package.

Finally, I tried deleting all derived data, remove the package, add it back and rebuild the project.



Solution

I fixed that due to next command:

git config --global tag.forcesignannotated false


This Question was asked in StackOverflow by Taras and Answered by Taras It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?