8

I am getting error as mentioned below:

Update failed Invocation failed Unexpected Response from Server: Unauthorized java.lang.RuntimeException: Invocation failed Unexpected Response from Server: Unauthorized at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassXmlRpcClient.handleInput(GitNativeSshAskPassXmlRpcClient.java:34) at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassApp.main(GitNativeSshAskPassApp.java:30) Caused by: java.io.IOException: Unexpected Response from Server: Unauthorized at org.apache.xmlrpc.LiteXmlRpcTransport.sendRequest(LiteXmlRpcTransport.java:231) at org.apache.xmlrpc.LiteXmlRpcTransport.sendXmlRpc(LiteXmlRpcTransport.java:90) at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178) at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassXmlRpcClient.handleInput(GitNat

In previous versions, I managed to fix it like this:

AndroidStudio -> Preferences -> Git -> SSH Executable and changed from Native to Built-in and it started working. See UI here: https://i.stack.imgur.com/KCvHA.png

But in android studio 3.6, I don't see above option in settings.

enter image description here

I have also tested the git using Test button at top right. Git is executing successfully.

enter image description here

Nikos Hidalgo
  • 3,094
  • 9
  • 17
  • 30
AnV
  • 2,486
  • 3
  • 28
  • 36
  • 2
    I also have this issue. It's terrible and I can't find any workaround right now. I found a Google issue that was reopened few days ago: https://issuetracker.google.com/issues/124680708 – Ruslan Berozov Feb 26 '20 at 11:47
  • Thanks for the issue tracker link. I have added a comment there with details – AnV Feb 26 '20 at 12:06
  • 1
    I have the same issue – John Smith Feb 26 '20 at 13:11
  • 3
    Me too. I was going to add a new ssh certificate using this tutorial from git... https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent But in my case i found that just doing step 3... Add your SSH private key to the ssh-agent $ ssh-add -K ~/.ssh/id_rsa and then trying android studio seemed to fix the issue. – aidanmack Feb 26 '20 at 14:01
  • I was just typing a question describing me having exactly this issue and then I read "Similar questions" ... – 0ne_Up Feb 26 '20 at 14:23
  • 2
    I also wanted to add that `git pull` and `git push` is working from the terminal, executed in the project directory. – 0ne_Up Feb 26 '20 at 15:33
  • The same on a windows machine. On the mac, reset ssh helped. – Vitaliy Ptitsin Feb 26 '20 at 20:12
  • I want to confirm that thanks to @aidanmack I was able to fix the same issue. – Massimo Baldrighi Feb 26 '20 at 23:43
  • 1
    But what if I don't have an SSH key and I'm using password authentication? – 0ne_Up Feb 27 '20 at 06:16

2 Answers2

1

This issue is resolved in Android Studio 3.6.1. I verified it by updating from 3.6 to 3.6.1 and git is working as expected

You can find release notes here. It says

Git version control authentication issue resolved

In the initial release of Android Studio 3.6, operations requiring authentication in Git version control were broken in the IDE. This bug has been fixed in 3.6.1. See Issue #124680708 for more information.

AnV
  • 2,486
  • 3
  • 28
  • 36
0

Go to -

Android Studio -> Setting-> GitHub

If you can't login using username and password try to get a Token from GitHub from here -

https://github.com/settings/tokens/new

and then generate new token if you don't have one. And finally login with Token

enter image description here

Gk Mohammad Emon
  • 2,407
  • 2
  • 20
  • 28