Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift Package Manager could not be resolved all libraries, project

enter image description here

This error always happens whenever I add a new Package via Swift Package Manager in Xcode:

Cannot fetch library

I've already configured my GitHub Auth Token setting in Xcode and registered my GitHub account.

My macOS version is Monterey 12.1, my Xcode version is 13.1, my command-line tools are 13.1, and I'm using an M1 chipset Mac.

enter image description here

like image 285
iostaeha Avatar asked Jan 29 '26 22:01

iostaeha


1 Answers

Configure Dependency Rule 📏

tl;dr

I encountered this issue today and managed to resolve the Package by changing the Dependency Rule from Branch -> master to Up to Next Major Version and checking their latest Release versions from GitHub.

Other Dependency Rules

We can also try changing from Branch to other rules depending on our application:

  1. Up to Next Major Version: Useful for getting the latest major stable release.
  2. Up to Next Minor Version: Useful for getting the very latest releases.
  3. Range of Versions: Useful for resolving dependencies specific to a particular dependency chain (careful configuration).
  4. Exact Version: Useful for pinning a version to a particular working release, or fork.
  5. Commit: Useful for pinning a Package to a commit rather than a release version.

Xcode SPM "Add Package" prompt

Xcode Add Package prompt

like image 92
Pranav Kasetti Avatar answered Feb 01 '26 12:02

Pranav Kasetti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!