2

I'm getting the following error while trying to push or pull or anything with ssh in android studio 3.6

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..................

looks like the problem is with native ssh and we cannot change it to built-in like previous versions... how to fix this ???

any help would be appreciated

Mehrdad
  • 49
  • 10
  • I have the same issue, other question on this here: https://stackoverflow.com/questions/60412242/not-able-to-git-pull-in-android-studio-3-6 but no solution as far as I know – 0ne_Up Feb 28 '20 at 18:09

3 Answers3

3

WORKAROUND: 1. In Android Studio go to Help - Find Action - Registry... 2. Find git.use.builtin.ssh and enable it 3. Check that git works again

Mehrdad
  • 49
  • 10
  • Might want to reconsider this answer based on the description for that value: "Builtin client is outdated and does not support modern security keys, it is not recommended to use it." – Adrian Romanelli Oct 30 '20 at 23:07
-1

Not straight solution - but you can change your git url from ssh to https, and it will work.

git remote set-url origin YOUR_REPOSITORY_HTTPS_URL
mrtransistor
  • 31
  • 1
  • 8
-1

I have found an alternative way to make SSH actually work... rate up if it worked for you!!!

using putty plink for ssh instead of the Git ssh(openSSH)

1.set the system env-variable GIT_SSH and let it point to plink.exe download links available here: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

2.start pageant and add your private key to it (needs to be converted to another format to be used)(use puttygen to convert id_rsa to ppk)

3.use command in terminal based on github or gitlab : plink -v git@github.com or plink -v git@gitlab.com

congrats now you can work with ssh

Mehrdad
  • 49
  • 10
  • This doesn't answer the question, you are providing some workaround, but the question was how to make it work in Android Studio. I can also push/pull from the terminal. – 0ne_Up Feb 28 '20 at 18:11
  • @0ne_Up check the latest answer – Mehrdad Feb 29 '20 at 13:20
  • but this one makes it work in Android Studio... it makes SSH work like before IN Android Studio – Mehrdad Feb 29 '20 at 13:21