问题
I've started working with Android Studio and I found a problem when trying to connect to Github. I've tried restarting Android Studio and even creating a new project, but I am not able to login.
I installed Git and it´s working in the local repository.
The problems are:
Incorrect credentials
Request response: 401 unauthorized

回答1:
You can use the Project from Version Control, it has git.
What I did was I logged in through a token, it also tells you what needs to be added to the token and that worked for me.
You can create the token here: https://github.com/settings/tokens
回答2:
Updating to AndroidStudio 4.1.1 allowed me to access with my credentials without having to generate a token.
回答3:
you can install git in your operation system and use command for add your android project to github repository.
1- you should install git bash
2- open git bash in your project directory and initial it as a git repository
- git init -b main
3- add your project to the local repository
- git add .
4- commit your file to the local git repository
- git commit -m "First commit"
5- Create a branch, usually called a 'main' or 'master'
- git branch -M main
6- define remote git url
- git remote add origin remote repository URL
7- finally, you should push all your project into remote git repository
- git push -u origin main
回答4:
I got the issue solved by generating a token from https://github.com/settings/tokens and using it to add account option on Android Studio>File>settings>GitHub
来源:https://stackoverflow.com/questions/64829341/android-studio-github-login-problem-incorrect-credentials