Taras
Taras

Reputation: 1899

Couldn't get a list of tags. Unexpectadly did not find the new dependency in the package graph. Package could not be resolved Xcode 16.1

I want to add packages like SnapKit, Resolver, etc. Actually, it doesn't matter what package I want to add - the same result. Even adding a local package. Here is an error error: Couldn't get a list of tags. Unexpectadly did not find the new dependency in the package graph: sourceControl(identity: snapkit, location: SwiftPM.SPMPackageDependency.SourceControlLocation.remote(SwiftPM.SPMSourceControlURL(sourceControlURL: https://github.com/SnapKit/SnapKit.git)), requirement: 5.7.1 – Next Major)

enter image description here enter image description here

Steps that didn't help:

  1. Clear Xcode’s Derived Data and Package Caches Manually:
  1. Delete and Re-add the Dependencies
  2. Disable Package Caching Temporarily
  3. Verify GitHub Access and Authentication
  4. Check Network and GitHub Status (using git clone - it works!)
  5. Restart laptop
  6. List item

Xcode 16.1 macOS 15.1 (Intel Core i7) iOS 18.0

Upvotes: 11

Views: 1602

Answers (2)

Michael
Michael

Reputation: 9894

My projects Package.resolved file was corrupted somehow. Here is how to solve:

  1. Delete the file
rm /Users/YOUR_PROFILE/Desktop/YOUR_PROJECT.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
  1. Clean Derived Data
rm -rf ~/Library/Developer/Xcode/DerivedData
  1. Resolve packages

From your project directory.

xcodebuild -resolvePackageDependencies

Hope it works for you! Not sure what was going on with Xcode on this one.

Upvotes: 0

mcatach
mcatach

Reputation: 1586

UPDATE: You can fix the issue by updating to SourceTree version 4.2.10. No further actions needed

It's an issue related to SourceTree. In version 4.2.9, they added a setting to the .gitconfig file that's breaking SPM.

More info here: https://jira.atlassian.com/browse/SRCTREE-8176

Citing @clopex:

Basically you need to run command in terminal: open ~/.gitconfig then remove: [safe] bareRepository = explicit save it and that is

Upvotes: 24

Related Questions