0

I am getting this error when trying to login with facebook.

The key hash does not match any stored key hashes.

I faced this similar error before but usually when this error appear, the facebook itself will show the key hash and what I do is just copy the key hash and register it in my facebook app. But the situation now is different because when I get the error above, I did not receive any key hash so I have no idea how to re-generate the key hash.

What I know is, you cannot use the command to re-generate another key hash for the second time like in the following code below.

keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64

For additional information just in case if this is related, the app is previously developed and the first key hash generated from other device. I copied the project and use another laptop to do the debugging. Just a guess, maybe this is one of the reason why the facebook app isn't showing the mismatch key hash?

Emerald
  • 864
  • 1
  • 14
  • 37

1 Answers1

0

You can still generate the key hash with the command

keytool -exportcert -alias androiddebugkey -keystore "your-release-key-path" | "your-openssl-path" sha1 -binary |"your-openssl-path" base64

You may want to check this post How to create Android Facebook Key Hash?

Leon
  • 329
  • 2
  • 3
  • 15
  • Okay I've tried this and there is a key hash shown but after I register it to facebook app, the error is still showing key hash does not match. – Emerald May 14 '19 at 10:15