In my Xcode settings, I'm logged into my GitHub account (where 2fa is turned on) as a Source Control Account. I currently have it set up to use SSH and my SSH key. I've created an access token and securely saved that string on my machine. I can successfully add the package when I use an SSH URL (which makes sense, such as git@github.com:{username}/{repo_name}.git.
I can't get adding via HTTPS to work for some reason. It always results in the following error:
Error while fetching remote repository: https://github.com/{username}/{repo_name}.git
Authentication failed because no credentials were provided.
Is this a known Xcode error? I haven't found an answer here on SO. Is it because I'm using 2FA? All the packages have the same instruction which is essentially "Just copy and paste this URL into SPM to add" but that's never worked for me.
Would love some insight here. Thanks!