skip to Main Content

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


  1. In MacOS, I fixed changing inside:

    Android Studio -> Preferences -> Version control -> Git 
    [Use credential helper] to enable (without this didn't allow me to save the git address).
    

    Then on the top menu:

    Git -> Git remotes then + 
    Add your git https address
    

    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).

    Login or Signup to reply.
  2. I also had the same issue last week. I solved this with following steps:-

    1. Installed latest version of Git on my PC(Windows)

    2. Opened project home directory in Command Prompt

    3. 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

    4. I copied that password and went to command prompt again and executed git command (git push in my case)

    5. I prompted for bitbucket password first, I entered the password

    6. Then within cmd prompt I prompted for repository password, I entered the app password there

    7. 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!

    Login or Signup to reply.
  3. 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

    1. deleted the expired user in the settings Version Control > GitHub.
    2. then created the user with a new Access Token log in with Token, Generate...,
    3. then cleared the VCS Log caches and indexes File > Invalidate Caches... > Clear VCS Log caches and indexes,

    I was able to complete the pending push request successfully.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search