Search code examples
androidfacebook-android-sdk

Android app Key Hash doesn't match any stored key hashes


I have an application on production on Play Store which uses a login with the Facebook SDK. When I debug the application from Eclipse there is no problem, but when its on production it gives me the following error after Facebook asks me for the permissions. I have added on my app page on developers.facebook.com the key hash generated with keytool using this command:

keytool -exportcert -alias diego -keystore "C:\Users\Diego\Desktop\CeluChat.KeyStore" | "C:\openssl\bin\openssl.exe" sha1 -binary | "C:\openssl\bin\openssl.exe" base64

CeluChat.KeyStore is the keystore I used when I exported the signed application, and when keytool promts me for the password, I entered the same when exported.

But the error that gives me on production (downloaded from Play Store) is:

10-20 22:21:10.752: W/fb4a(:):BlueServiceQueue(5872): com.facebook.http.protocol.ApiException: Key hash VQ3XhZb5_tBH9oGe2WW32DDdNS0 does not match any stored key hashes.

The Key Hash that is on the exception is different from the key hash generated with keytool. Anyway I added the Key Hash on Facebook, but it is still not working.


Solution

  • Facebook some how replaces +,- and / with _

    So just try replacing _ with +, - and / and add that hash-key.

    Hopefully it should work.