Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 11 SPM authentication failed because no credentials provided

Tags:

git

xcode

ios

swift

I started using Swift package manager and when I add repository with https (https://github.com/Alamofire/Alamofire.git) address authentication always fails when I try to login with my github account

Xcode authentication fail

But if I'm using [email protected]:Alamofire/Alamofire.git it will get added successfully. I tried regenerating new key, deleted .ssh directory but nothing makes https work and I still get xcode authentication failed because no credentials were provided error. I could use locally ssh url but in CI I need one with https.

like image 525
Simonas Daniliauskas Avatar asked Sep 30 '19 10:09

Simonas Daniliauskas


2 Answers

It was a problem with git config. In .gitconfig file it was set to

[email protected] "https://github.com/:

After removing this section https worked correctly

EDIT: as mentioned in comments you can easily access your gitconfig in terminal with command: git config --global --edit

like image 81
Simonas Daniliauskas Avatar answered Sep 28 '22 08:09

Simonas Daniliauskas


In my case with Xcode 11.3.1 I had the same problem and I solved changing de auth method to SSH from HTTPS in Github account preferences on Xcode.

enter image description here

like image 39
Abrahanfer Avatar answered Sep 28 '22 09:09

Abrahanfer