最近把Android studio升級到3.6版本之后煮盼,在使用git的pull/push的時候遇到了一個問題全跨。
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(GitNativeSshAskPassXmlRpcClient.java:31) ... 1 more git@gitee.com: Permission denied (publickey). Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
查了一遍,都是基于 Android studio 3.4
版本的解決方法矾麻,但是這個方法已經(jīng)不適用于 3.6
版本了窍奋。
真正的解決方法是這樣的: Help -> Find Action
,搜索 Registry...
暖璧,然后找到 git.use.builtin.ssh
之后打勾案怯。
這樣就ok了。