Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve Swift packages after 15th March 2022 in Xcode

Package resolution is suddenly failing in Xcode. I tried the following options:

  1. Reset cache under File/Packages/Reset Package Caches
  2. Delete shared SPM cache using rm -Rf ~/Library/Caches/org.swift.swiftpm/

I can see the following error for different packages.

You're using an RSA key with SHA-1, which is no longer allowed. Please use newer client or a different key type.

like image 248
Haseeb Iqbal Avatar asked Dec 02 '25 20:12

Haseeb Iqbal


1 Answers

After looking around, I found a GitHub security blog post that mentions that from 15th March 2022 onward, RSA keys with SHA-1 are no longer accepted. See the blog post here.

I tried creating an SSH key with the command provided in GitHub's documentation but Xcode does not accept the ED25519 encryption method, and commands provided by GitHub docs do not work.

Eventually I found this nice post that explains the issue and offers an alternative encryption method, ECDSA, that is accepted by Xcode.

Use the following command to create new SSH key and add it to GitHub.

ssh-keygen -t ecdsa -b 521 -C "[email protected]"

like image 162
Haseeb Iqbal Avatar answered Dec 04 '25 10:12

Haseeb Iqbal