问题描述
在使用android studio的时候 点击拉取代码,和提交代码push提示报错失败如下:
17:32 Update failed
Invocation failed Unexpected end of file from server
java.lang.RuntimeException: Invocation failed Unexpected end of file from server
at org.jetbrains.git4idea.GitAppUtil.sendXmlRequest(GitAppUtil.java:30)
at org.jetbrains.git4idea.http.GitAskPassApp.main(GitAskPassApp.java:58)
Caused by: java.net.SocketException: Unexpected end of file from server
at 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)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1615)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at org.apache.xmlrpc.DefaultXmlRpcTransport.sendXmlRpc(DefaultXmlRpcTransport... (show balloon)
unable to read askpass response from
'C:\Users\Administrator\AppData\Local\Google\AndroidStudio2021.1\tmp\intellij-git-askpass-local.sh'
bash: /dev/tty: No such device or address
failed to execute prompt script (exit code 1)
could not read Username for 'https://git.aalws.com': No such file or directory
原因分析:
提示:这里填写问题的分析:
这里的报错
unable to read askpass response from
'C:\Users\Administrator\AppData\Local\Google\AndroidStudio2021.1\tmp\intellij-git-askpass-local.sh'
bash: /dev/tty: No such device or address
failed to execute prompt script (exit code 1)
could not read Username for 'https://git.aalws.com': No such file or directory
这里报错首先说读取的bash:/dev/tty 没有如此的设备和地址
下面又说没有从这段 http://git.aalws.com 通过username读取到文件
说白了 就是出现了帐号密码的错误
解决方案:
提示:这里填写该问题的具体解决方案:
1.首先确认自己是否已经添加git的window凭证:在控制面板-用户帐号-凭据管理器-windows凭据中添加
凭据:
2.如果凭据添加好了:使用git测试 git commit是否可以拉取代码
3.如果上述都已经完成:
这里是最关键的一步(其实在大多数遇到这个问题的人上述两个问题都会配置好的,但是为什么我们会拉取代码,提交代码失败呢,是因为还需要在android studio 中git配置中勾选使用凭证助手,这个凭证助手在安装android studio的时候是默认没有勾选的,只有勾选了这个选项,我们再windows中配置的凭证,andorid 开发工具才可以使用)