I have a git project at Android Studio and a remote at BitBucket and I changed it to use SSH instead of HTTPS. I can make everything work using Atlassian\'s SourceTree, but in A
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: