I ran across this myself, and found the existing answers were a bit incomplete.
tl;dr: Switching Android Studio/IntelliJ's SSH client from built-in to native may resolve the issue for you (it did for me).
Android Studio (effectively a specialized IntelliJ IDEA) comes with its own built-in SSH client, but allows you to switch to native (platform / OS dependent) if you prefer. You can change this by opening your Android Studio options, search for 'git', and choose 'native' in the SSH executable dropdown.
In my case, I was unable to push to BitBucket through Android Studio, but git push
worked just fine. Switching to native (OSX SSH, in my case) resolved the issue - now I can push to BitBucket from Android Studio.
Other answers touched on the subject, but there appears to have been some mixup between SSH executables and the keys that they use.
Per Android Studio help under SSH Executable:
- Built-in: select this option to use the implementation provided by IntelliJ IDEA.
- Native: select this option to use native implementation.
git remote -v
shows the remote...using the terminal inside Android Studio – Heighten