android facebook integration: invalid key hash - android

The Facebook error message is :
Invalid key hash. The key hash xxxxxxx= does not match any stored key hashes...
I know this issue has been already treated but i still have the problem. I wrote below the detailled process but i should have miss something. Please help.
I am working on windows 10/Cordova/android.
Open cmd window as adminstrator
npm update -g cordova
cordova platform update android
cd platforms\android\build\outputs\apk; rm *.apk
keytool -genkey -v -keystore myapp.keystore -alias myappalias-keyalg RSA -keysize 2048 -validity 10000
cordova build android –release
Create platforms\android\release-signing.properties file including:
storeType=jks
keyAlias=myappalias
keyPassword=mypass
storePassword=mypass
remove the app from the android-smartphone
cordova run android –release
The key hash i cut& paste in the facebook field is given by the command:
keytool -exportcert -list -v -alias myappalias -keystore myapp.keystore | openssl sha1 -binary | openssl base64
It includes the sign =
Any Idea ?

Try this:
keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | openssl sha1 -binary | openssl base64

You can also use this.
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

Related

keytool -exportcert -alias androiddebugkey -keystore "C:\...\debug.keystore" | "PATH_SSL\bin\openssl" sha1 -binary | "PATH_SSL\bin\openssl" base64

I need to generate a Development Key Hash because I am getting this error on my Facebook Login implementation for Android app:
The official Facebook documentation at https://developers.facebook.com/ when I access it from my Facebook account, provides this information:
They provide the following code for Windows:
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\USERNAME\.android\debug.keystore" | "PATH_TO_OPENSSL_LIBRARY\bin\openssl" sha1 -binary | "PATH_TO_OPENSSL_LIBRARY\bin\openssl" base64
I created the following empty folder on my computer: C:\Users\jmont\Documents\key:
I ran the following from the command line:
C:\Program Files\Java\jre1.8.0_341\bin>keytool -exportcert -alias androiddebugkey -keystore "C:\Users\jmont\Documents\key\debug.keystore" | "C:\Program Files\openssl-0.9.8k_WIN32\bin\openssl" sha1 -binary | "C:\Program Files\openssl-0.9.8k_WIN32\bin\openssl" base64
tR7PbbRhsiXgMNogn/cCg5DAl6A=
I was expecting to see a KEYSTORE File at C:\Users\jmont\Documents\key, but the folder remains empty. No error was thrown from my execution of the command shown above, and apparently the Key Hash tR7PbbRhsiXgMNogn/cCg5DAl6A= was successfully generated. Where did the debug.keystore file was exported to? Where can I find that KEYSTORE File? Thank you.

How do I generate SHA1 and Key Hash in Windows 8

I know How to generate SHA1 and Key Hash in Ubuntu 12.04, but don't know How to generate in Windows 8
To generate SHA1 in Linux Ubuntu 12.04, using following command in terminal:
Debug
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Release
keytool -list -v -keystore <keystore_path> -alias <alias_name>
To generate Key Hash in Linux Ubuntu 12.04, using following command in terminal:
Debug
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
Release
keytool -exportcert -alias <alias_name> -keystore <keystore_path> | openssl sha1 -binary | openssl base64
Note: I have followed this link to generate SHA1 Certificate fingerprint for Debug and Release modes
Its quite similar
FOR SHA1:
Open command prompt, type the following
cd C:\Program Files\Java\jdk1.8.0_45\bin
keytool -list -v -keystore C:\PathToKeyStore -alias -storepass password -keypass password
FOR KEYHASH:
download https://code.google.com/p/openssl-for-windows/downloads/detail?name=openssl-0.9.8e_X64.zip&can=2&q=
Extra to C:/
Go cmd and type cd C:\Program Files\Java\jdk1.8.0_45\bin
keytool -exportcert -alias -keystore "C:\PathToKeyStore" | "C:\openssl-0.9.8e_X64\bin\openssl" sha1 -binary |"C:\openssl-0.9.8e_X64\bin\openssl" base64

signing my application using keytool

well i am stuck on this step too
$ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 Enter keystore password: android
please any body explain it
after i tried on cmd i get it and it do as follow
first locate keytool in your system by cd \path\
after that write this line as it is
$ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
and this one mean ~/.android/debug.keystore
the path where your keystore exported from eclips
and to make sure that the hashkey generated is really right the cmd should ask you about the password you use to generate keystore

Hash Key Facebook API. Android for release mode not debug. MAC OS

Well.. first of all, sorry for my english..
The api facebook works perfectly in the emulator but when i put it on a mobile it doesnt work.. just open and close the window.. so..
I found this 2 commands to generate the Hash Key but i dont know witch one is the correct or what im doing wrong, because i write any password and the command works but at the mobile not..
This is for debug mode.. and the password is default "android"
keytool -exportcert -alias androiddebugkey -keystore /Users/user/.android/debug.keystore | openssl sha1 -binary | openssl enc -a -e
This is for release mode.. and the password is the password of your signing key..
keytool -exportcert -alias androiddebugkey -keystore /Users/user/Desktop/testsing | openssl sha1 -binary | openssl enc -a -e
What I am doing wrong?
Thank you!!
You can try this way to bu sure 100%
Go to Your folder on command prompt with Java\bin like example: C:\Program Files\Java\jdk1.7.0_09\bin>
Prepare your commands
from facebook developer tutorial:
keytool -exportcert -alias androiddebugkey -keystore
%HOMEPATH%.android\debug.keystore | openssl sha1 -binary | openssl
base64
if you have any problem with openssl you can download it and install example on C:\OpenSSL and then
keytool -exportcert -alias androiddebugkey -keystore
%HOMEPATH%.android\debug.keystore | "C:\OpenSSL\bin\openssl" sha1 -binary | "C:\OpenSSL\bin\openssl" base64

Whats the proper keytool command to get facebook app signature on android?

I am trying to use openssl to export the key for my app. I followed the facebook developers guide but I am stuck when it comes to the keytool command.
Facebook has it this way:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
I have mine this way:
"C:\Program Files\Java\jdk1.6.0_23\bin\keytool" -exportcert -alias androiddebugkey -keystore "C:\Users\blah\.android\debug.keystore" | "C:\blah\bin\openssl" sha1 -binary |"C:\blah\bin\openssl" base64
I run openssl.exe as an administrator. When I run the above command, it says "Openssl Error: "C:\program files\java\jdk1.6.0_23\bin\keytool"" is an invalid command.
Please help! Thanks
I got it to work on Windows 7 by doing the following:
Copy the entire bin directory from the openssl install to the jdk.x.x\bin directory where the keytool is.
Run the command as shown in the facebook doc as follows:
keytool -exportcert -alias androiddebugkey -keystore C:\Users\MYUSER\.android\debug.keystore | openssl sha1 -binary | openssl base64
It asks for a password (only once) which is android
Hope this works for you

Categories

Resources