1
votes

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?

3

3 Answers

0
votes

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

0
votes

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

0
votes

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.