如何修复调用失败 来自服务器的意外响应:Android工作室中的未经授权

2022-08-31 09:13:01

我在Gitlab上有一个项目,在过去的几天里我一直在使用它!

现在我想在我的家用PC上拉项目,但向我显示以下错误:

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)

我的安卓工作室版本是3.4


答案 1

启用凭据助手适用于我,在Windows 10上使用Android Studio 3.6.2

AndroidStudio -> File -> Settings -> Git -> Use credential helper


答案 2

设法像这样修复它:

AndroidStudio -> Preferences -> Git -> SSH Executable,并从 更改为,它开始工作。NativeBuilt-in

编辑:这是针对Android Studio 3.4,对于3.6 Volodymyr在下面有一个答案。


推荐