Facebook key hash does not match any stored key hashes

DATE UPDATED EVERY TIME I GOT UPVOTE AS I KNOW IT IS STILL VALID

DATE: 1/07/2022 (1st of July 2022)

This is how I solved this problem

  1. I have got the SHA1 from signingReport

(found in gradle-->app/Tasks/android/signingReport)

Copy the SHA1 value to your clipboard

like this XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX

  1. Facebook sdk requires it to be in base64 hash key so we open http://tomeko.net/online_tools/hex_to_base64.php

to convert your SHA1 value to base64.

This is what Facebook requires get the generated hash " ********************= "

  1. open https://developers.facebook.com/

  2. select your project in the setting tab, basic/Key Hashes add the generated key.

  3. don't forget to save changes.


After hours of trying I've finally found a solution.

  1. Delete any app on the website of Facebook (developers.facebook.com)
  2. Delete the file debug.keystore under C:\Users\yourUserName\.android
  3. Generate a new key (by running your app again)
  4. Create a new app on developers.facebook.com and add the new hash key
  5. Re-run your app
  6. Succes!

If your login is working without installing facebook app and not working when facebook app is installed due to error "hash key has not match" then do following steps

1 ) Launch your app and try to log in with facebook. A dialog will open and tell you: "the key has not been found in the facebook developer console and also show the hash key.

2 ) Note down that hash key.

3 ) Put it into your facebook developer console where you first generated your api key and remove the hash key with new and save. Now you are done. Anyone that downloads your app, published with earlier used keystore can log into facebook.


This is a case that could have possibly occurred and what solved my error:

In the https://developers.facebook.com/quickstarts after you run

OSX/Linux:

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

Windows:

keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64

When Enter keystore password: is asked you may have accidentally typed a wrong password, the default password is "android". Typing any other password will give you a different/wrong hash key. Paste the correct hash key in the Key Hashes field on your app page

This solved my problem, hope this helps whoever made this particular error that I made