I’ve been trying to get android studio to clone a git repository, but I receive the error: ‘Invocation failed Unexpected end of file from server’. I’ve tried enabling credential manager in settings as many tutorials have stated, reinstalling git, and reinstalling Android Studio, but it doesn’t appear to be working. Currently running Manjaro Linux 21.2.4. and Android Studio Stable 2021.1.1. However using Android Studio Canary it works as expected, prompting my username and password of the server. I am also not receiving this error on a Windows machine. Here is the full error. What do you think is causing this?
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 '/home/user/.cache/Google/AndroidStudio2021.1/tmp/intellij-git-askpass-local.sh'
fatal: could not read Username for 'https://git.url.test': No such device or address```
3
Answers
In MacOS, I fixed changing inside:
Then on the top menu:
Now, in my case, git pull failed because it didn’t had a tracked branch. But allowed me to choose an upstream branch in the event log – this showed me an empty branch. Then I selected master and check a check box (sorry, I can’t remember what it said).
I also had the same issue last week. I solved this with following steps:-
Installed latest version of Git on my PC(Windows)
Opened project home directory in Command Prompt
Then from my browser, I logged in to my bitbucket account and I created app password, which is now mandatory I guess. Here are the steps to create app password
I copied that password and went to command prompt again and executed git command (git push in my case)
I prompted for bitbucket password first, I entered the password
Then within cmd prompt I prompted for repository password, I entered the app password there
Git command ran successfully. After that, I am able to perform git actions from within Android Studio again
Hope the same steps may help you too!
In my case (Android Studio on a Mac) the Access Token had expired. All the suggestions described (including here) did not work.
Only when I
Version Control > GitHub
.log in with Token, Generate...
,File > Invalidate Caches... > Clear VCS Log caches and indexes
,I was able to complete the pending push request successfully.