Hi,
Overview
I would like to add a Swift Package to my Xcode project.
Problem
- In Xcode when I select Project > Package Dependencies and Press + button to add a dependency it keeps spinning and doesn't end
Points to note:
- Xcode 26.5 (17F42)
- macOS 26.5 (25F71)
- This is a private GitHub repository
- I am able to clone the Swift Package URL on the command line.
- Xcode has the GitHub account
- I am able to push and pull code on that GitHub account using Xcode
My failed attempt
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Caches/org.swift.swiftpm
plutil -remove IDESwiftPackageAdditionAssistantRecentlyUsedPackages ~/Library/Preferences/com.apple.dt.Xcode.plist
- I have removed GitHub account in Xcode and added it again
I am confused if I am missing something very obvious, any help on this is much appreciated.
Questions
- Is there any workaround or way to fix this issue?
- Why does this take such a long time when I have a specific URL, either it needs to add it or return that the package is not found. Why is it searching?
Problem
- The actual issue for me is Xcode when adding a new package and entering the URL in the search box where it keeps spinning (even over an hour) never ends.
- This seems like an Xcode bug
Workaround
- Add one of the
Apple Swift Packageswhich comes pre-loaded with Xcode likeswift-algorithms - Once added that screen gets dismissed and the
swift-algorithmsURL is added as a dependency - Now click on the
swift-algorithmsand change it to your URL and also update theDependency Rule
This will add the your swift package and pull the code.
DTS Engineer:
- @DTS Engineer this seems like an Xcode bug.