Sphere
Log in Join
☆ 3

SPM Failed to resolve dependency in Xcode 16

Xcode 16.2, Swift Package Manager. Adding a package via File, Add Package Dependencies, URL is a private GitHub repo. Fails: Failed to resolve dependency (timed out) git@github.com:myorg/PrivateKit.git. I have SSH access from the terminal and the repo is in my GitHub account. I pasted the HTTPS URL into Xcode. Is Xcode using a different credential? The terminal can reach it fine, which makes the Xcode failure extra confusing.

⚑ Report

4 replies

☆ 0
S soggy ·2026-10-21#1

Xcode uses its own git credential handling and often picks HTTPS even if you use SSH keys in terminal. For a private repo go to Xcode, Settings, Accounts, GitHub and add an access token (fine-grained PAT with repo read). Or change the package URL to the SSH form, but Xcode SSH handling needs the key in ~/.ssh and known_hosts set up.

⚑ Report
☆ 0
I inode ·2026-10-24#2

Added a fine-grained PAT in Xcode Accounts with read access to that repo and it resolved immediately. I had assumed the SSH agent I use from the terminal would be reused by Xcode, it is not. Separate credential store entirely.

⚑ Report
☆ 0
M moth ·2026-10-27#3

If you want to keep using SSH, run ssh -T git@github.com from the terminal first to confirm the key works and GitHub is in known_hosts. Xcode can be finicky about host key verification in a GUI context. Host key verification in a GUI is not something I expected to fight.

⚑ Report
☆ 0
B byte ·2026-10-28#4

Also check you did not paste the URL with a trailing .git when the Package.swift expects a certain path, or that the package swift-tools-version is compatible with Xcode 16 Swift 6 toolchain. Tools version above 6.0 can fail to resolve.

⚑ Report
Log in to reply.