40

Error occurred while cloning repository in Android Studio

error: unable to read askpass response from
'C:\Users\User\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

Sanakhatun Shaikh
  • 2,089
  • 3
  • 11
  • 18

7 Answers7

136

Resolved above issue with below steps:

  1. Click on the File Menu of Android Studio -> Settings -> Expand Version Control
  2. Inside Version Control, select Git & Check Use Credential Helper

enter image description here

Sanakhatun Shaikh
  • 2,089
  • 3
  • 11
  • 18
  • 2
    I checked it but then what? what needs to happen? – Azizjon Kholmatov Mar 14 '22 at 13:12
  • 2
    Then you start your checkout again, it will ask to enter your credentials. – Sanakhatun Shaikh Mar 15 '22 at 09:56
  • With 'git push' and GitLab works too. For me, this answer could be the solution. – bishop Mar 29 '22 at 18:42
  • 7
    This solution does not help me. I have put login credential when an alert dialog pops from github but It's still showing `error: unable to read askpass response from 'C:\Users\91700\AppData\Local\Google\AndroidStudio2021.2\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 'https://github.com': No such file or directory ` Do you have any other solution please help –  May 14 '22 at 09:32
  • For me above solution worked after putting my credentials when asked while performing git fetch. – nitinkumarp Jun 08 '22 at 15:49
  • 5
    After the above step, I also had to restart Android Studio in order to work – Fivos Jun 23 '22 at 08:25
  • What does this checkbox do? – marticztn Jul 19 '22 at 06:22
  • Thanks for the help, your answer saved a lot of time. Add to answer that Android Studio should be restarted (preferably via "invalidate cache and restart") in order to work – AShX Jul 26 '22 at 19:46
  • 1
    not working for me, I am using Gitlab. I am not getting dialog popup to enter username and password. :( – Sandeep Yohans Sep 01 '22 at 11:43
13

I simply resolved it by doing Invalidate Caches and Restart.

In Android Studio, Click on File > Invalidate Caches... > tick all checkboxes > Click Invalidate and Restart

zeeali
  • 1,524
  • 20
  • 31
2

I simply resolved it by doing Invalidate Caches and Restart.

In Android Studio, Click on File > Invalidate Caches... > tick all checkboxes > Click Invalidate and Restart

this worked for me.

Tawanny
  • 21
  • 2
2

For others that may be having this issue with any IntelliJ product (WebStorm in my case), disabling the Gitlab plugin under plugins solved the issue for me.

Credit to Matthew for figuring this out: https://youtrack.jetbrains.com/issue/IDEA-326514/unable-to-read-askpass-response-intellij-git-askpass-local.sh#27-7969570.0-0

JStanton
  • 425
  • 5
  • 12
0

1- clean your project 2- make invalid cash and restart your project 3- make sure you select the clean cash

0

It’s happens when credential in git are forgotten suddenly. (I don’t understand why it happens with me after year of working at project).

Steps to solve problem.

Open terminal in project’s folder.

git config --global credential.helper store
git pull

Specify your username and password.

If you use corporate GitLab probably you need to use token INSTEAD of password (it depends from corporate rules).

GitLab site -> Your avatar -> Edit profile -> Access Tokens -> Add new token

Don’t set “Expiration date” (or remember about it and re-generate new token after expiration of old token).

Check:

git fetch

Now you can use IDEA and fetch/clone/etc again.

After this steps I solved problem:

error: unable to read askpass response from '/home/***/.cache/JetBrains/IntelliJIdea2023.2/tmp/intellij-git-askpass-local.sh'
fatal: could not read Username for 'https://git.***.com': No such device or address
Oleg Poltoratskii
  • 667
  • 11
  • 10
-2

You can check in Use credential helper which helps you check your credential and if you didn't set up that before it would send you a question to login for create credential. [1]: https://i.stack.imgur.com/IFG8x.png