新版Android Studio 使用git pull push 报错 java.lang.RuntimeException: Invocation failed Unexpected end of file from server

 

2022 年 2 月 28 日 最新版 版本如下

Android Studio Bumblebee | 2021.1.1 Patch 2
Build #AI-211.7628.21.2111.8193401, built on February 17, 2022
Runtime version: 11.0.11+9-b60-7590822 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 5120M
Cores: 24
Registry: external.system.auto.import.disabled=true, ide.instant.shutdown=false, ide.usages.page.size=100000, ide.images.show.chessboard=true
Non-Bundled Plugins: org.intellij.plugins.markdown (211.7142.37)

环境配置好后,使用 git pull 代码,在文件夹使用 git 命令 正常,在 studio 中使用,报错 push pull 均报错,报错如下

 


16:39:55.811: [android] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false -c core.commentChar= pull --no-stat -v --progress origin spring31
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.java:87)
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.GitAppUtil.sendXmlRequest(GitAppUtil.java:27)
... 1 more
error: unable to read askpass response from 'C:\Users\xxxxxxx\AppData\Local\Google\AndroidStudio2021.1\tmp\intellij-git-askpass-local.sh'
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'http://gitlab.xxxxxx.com': No such file or directory

 

解决办法:

File | Settings | Version Control | Git 
勾选 : Use credential helper

 

 

 重新尝试 git pull  push  OK 了

另:新主机 64G 内存,以前 build 10 分钟,现在 2 分 ,生产力工具无疑了 

 


__EOF__

  • 本文作者: wang-xiaohao
  • 本文链接: https://www.cnblogs.com/wang-xiaohao/p/15946350.html
  • 关于博主: 评论和私信会在第一时间回复。或者直接私信我。
  • 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
  • 声援博主: 如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。