1

I try to add facebook login to my android app. I exactly followed the documentation but when I try to run a command line in Android Studio terminal to generate a development hash key, it says "'keytool' is not recognized as an internal or external command, operable program or batch file.

This is my command code:

keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%.android\debug.keystore | openssl sha1 -binary | openssl base64

What should I do?

Vadim Kotov
  • 7,766
  • 8
  • 46
  • 61

3 Answers3

0

Click on the gradle tab on the right hand side of android studio and navigate to :app and click on tasks -> android and run the signing report to get the hash key for your app, like this:

enter image description here

Vincent
  • 64
  • 8
0

You need to add <JDK location>\bin to PATH environment variable.

Artyom
  • 1,139
  • 15
  • 21
0

keytool ships with Android Studio as part of the JRE needed to run Android Studio itself.

For Windows its: C:\Program Files\Android\Android Studio\jre\bin\keytool.exe

For Mac its: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/keytool

Add this to your environment variables then run the keytool command again.

Tim Truston
  • 4,120
  • 6
  • 46
  • 59