Invalid key hash, key hash does not match any key stored key

I created an application on facebook. I added keyhash correctly and the application works fine, but when I come today and try to start it again, it gives me this error. enter image description here

This is the second time. Previsouly, when I get this error, I uninstalled the application and added it again, and it starts working again, and I cannot repeat it again and again.

Another thing, the key hash that he mentioned in the error is not the same as what I added to the application, and if I move on to configuring the application, then the hash key is correct there.

+8
android facebook
source share
8 answers

uninstall the application and try to create a new hash key by following these steps: method !

+4
source share

There is no need to remove the application from the Facebook developer website again and again. All you need to do is go to your terminal (Mac or Linux) and type:

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

And Window user open cmd and type:

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

After that, you will be prompted to enter "Enter the keystore password:", for this, remember that enter only android . Now use this key hash on the Facebook developer website (Note: this key hash will be the same as the key hash you received in the error). Mostly people are asking to remove the application from the Facebook developer website and make a new one again, but believe me, this is actually what you need to do.

+5
source share

Use one of the following versions: openssl-0.9.8e _X64.zip

You should not use openssl-0.9.8k_X64.zip .

Difference

k and e

and generate the key again using keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64 keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64 keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64 on cmd

+3
source share

You need to take the next step again: -

  • Uninstall the application on the Facebook website (developers.facebook.com)
  • Delete the debug.keystore file.
  • Create a new key (starting the application again)
  • Create a new application on developers.facebook.com and add a new hash key
  • Run the application
  • Sucches!

and more information see below link: -

https://developers.facebook.com/docs/android/getting-started/

+1
source share

Add the code below to onCreate (): * Remember to change the package name.

 try { PackageInfo info = getPackageManager().getPackageInfo( "com.yours.package", PackageManager.GET_SIGNATURES); for (Signature signature : info.signatures) { MessageDigest md = MessageDigest.getInstance("SHA"); md.update(signature.toByteArray()); Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT)); } } catch (NameNotFoundException e) { } catch (NoSuchAlgorithmException e) { } 

Source: https://developers.facebook.com/docs/android/getting-started/

+1
source share

Only one reason for this error, which is different from the Hash key for each development environment, means that if you work on different computers, each PC / Mac will generate its own hash key.

NOW DECISIONS:

In two simple steps, you can fix this error, just write the hash key in your Facebook Developer account, for example, attached images:

First step: you will see the HASH KEY hat key here, and then follow the next step enter the image description here

Last step: write the copied hash key in the hash field. as enter image description here

No need to uninstall or reconfigure the application.

Thanks.

0
source share

Hi In my case, it was a problem with generating a release key for production. To release the apk application for playback, you need to create a release key. Visit this link via Facebook for more details.

0
source share

In my case, I changed the name of the package AFTER the private key was created, so the key hash was incorrect / invalid.

0
source share

All Articles