AndroidStudioとGithubの連携をしてみました。
AndroidStudioで「Share Project On Github」をすると、Github上にレポジトリを作ってくれて、Pushしてくれます。
昔はID,PWでGithubにログインする形だったと思いますが、Githubの仕様が変わりPersonal Access Token(PAT)でログインする形に変わっていました。
Beginning August 13, 2021, we will no longer accept account passwords when authenticating Git operations on GitHub.com.
https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/
2021年の8月13日から、パスワードでのログインができなくなり、代わりにトークン認証を使う必要があります。
AndroidStudioで「Generate Token」を押すと、Githubのページに遷移してトークンを作ることができます。
トークンはGithubのページから作ることができますが設定項目がよく分からんので、AndroidStudioから「Generate Token」を押して遷移した方が簡単です。
トークンが作成できると以下のメールが届きます。
A personal access token (Android Studio GitHub integration plugin) with gist, read:org, repo, and workflow scopes was recently added to your account.
無事Githubと連携できてレポジトリも作成できたのですが、プッシュ時に以下のエラーが出ました。
Can’t finish GitHub sharing processSuccessfully created project ‘MapSample’ on GitHub, but initial push failed:Invocation failed Unexpected end of file from serverjava.lang.RuntimeException: Invocation failed Unexpected end of file from serverat git4idea.GitAppUtil.sendXmlRequest(GitAppUtil.java:30)at git4idea.http.GitAskPassApp.main(GitAskPassApp.java:58)Caused by: java.net.SocketException: Unexpected end of file from serverat java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:866)at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:863)at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)

14:47 Push failedremote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: could not read Username for ‘https://github.com’: Device not configured