4

I'm trying to create a Facebook integrated Android app, but trying to use Facebook's Android SDK is tiring. Here's the tutorial I'm following.

I'm stuck on the step Using the Keytool. I've searched around a bit and apparently I have to install OpenSSL which I promptly did.

I found keytool under these directories on my Windows machine:

C:\Program Files\Java\jdk1.6.0_25
C:\Program Files\Java\jdk1.7.0

When I run

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 from the tutorial on openssl

I get the following error:

openssl:Error: 'keytool' is an invalid command.
ask
  • 2,160
  • 7
  • 31
  • 42
  • 1
    http://stackoverflow.com/questions/7712361/android-single-sign-on Check this – Venky Jun 21 '12 at 05:35
  • 1
    This should be your Java Bin path , if you set Java path no need to specify this path , directly you can try keytool ... – Venky Jun 21 '12 at 07:10
  • OpenSSL> Enter keystore password: android openssl:Error: '1τÖ3┴(6Kû1▀╛c(¿╪≡ñWU' is an invalid command. – Harsha Nov 19 '15 at 10:02

2 Answers2

8

I followed Maulik J's post from the link provided by Venky here and tried this command in the command prompt and it worked:

C:\Program Files\Java\jdk1.7.0\bin>keytool -export -alias androiddebugkey -keystore "C:\Users\MyUser\.android\debug.keystore" | C:\Users\MyUser\Downloads\openssl-0.9.8k_X64\bin\openssl.exe sha1 -binary | C:\Users\MyUser\Downloads\openssl-0.9.8k_X64\bin\openssl.exe enc -a -e
Jacolack
  • 1,365
  • 2
  • 11
  • 25
ask
  • 2,160
  • 7
  • 31
  • 42
0

To be able to use keytool you need to have jdk installed and also openssl need to be on your pc you can download it here https://code.google.com/archive/p/openssl-for-windows/downloads

So currently i have mine here, so i have to cd to the directory

C:\Program Files\Java\jdk-11.0.13\bin>

And once i am in this directory i need to run the command

keytool -exportcert -alias <alias>  -keystore "C:\Users\Codertjay\.android\debug.keystore" | "C:\Users\Codertjay\Downloads\Compressed\openssl-0.9.8e_X64\bin\openssl.exe" sha1 -binary | "C:\Users\Codertjay\Downloads\Compressed\openssl-0.9.8e_X64\bin\openssl.exe" base64

Notice that the path in here has my name on PC you need to update yours to the right path

Codertjay
  • 588
  • 8
  • 13