I recently forked a Swift Package library from GitHub in order to implement a functionality that I’ve been missing. However, when I try to add my version of the package in a Xcode project (by adding the url of my fork), Xcode can’t find any results.
Is this an intended limitation of Swift Package Manager or am I missing something?
3
Answers
I finally worked around this limitation by manually editing both the project.pbxproj and Packages.resolved files, so that they point to the specific commit in the fork of the repository.
To do this, close Xcode and then open the two files with a plain text editor.
In the project.pbxproj file, change the url of the repo and the parameters needed to correctly specify the version rule. In my case, I wrote the hash of the commit I needed:
Do the same for the Packages.resolved file:
Obviously, this is not the ideal solution but at least it works ¯(ツ)/¯
In fact, this seems to be an intended limitation of Swift Package Manager. See:
Try to use
http
instead ofhttps
:EDIT:
After you tried with http and still have the problem you probably need to create a personal access token:
Now to use the token in Xcode:
In Xcode 14.0.1 started to work by defining commit hash like this: