Home » Android » Android invalid key and Facebook Connect

Android invalid key and Facebook Connect

Posted by: admin April 23, 2020 Leave a comment

Questions:

When I try to implement Facebook Connect in my Android application, I get the following error.

11-02 16:41:31.660: D/Facebook-authorize(13194): Login failed:
invalid_key:Android key mismatch. Your key
“8Ioc4p/jMXoU9Lezug4nzmZfFUg” does not match the allowed keys
specified in your application settings. Check your application
settings at http://www.facebook.com/developers

I reset the key in the Facebook App and still it shows the same error. How can I fix it?

How to&Answers:

Your key is: “8Ioc4p/jMXoU9Lezug4nzmZfFUg

Now copy this key and open this URL, and paste this key in the native Android app, marked with a green border.

Enter image description here

Answer:

I dont know if your problem is resolved right now but I was having the same problem as you and now I find the complete solution.

You have two enviroments for the development: debug and a signed application, when you use this commands to get your key

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 you are getting the key for the debug.keystore,

But when you sign the app you get a new key because your app is using a new keystore.You can get your “sign app key” using this program. http://www.easyfacebookandroidsdk.com/download/keyhash.zip but you have to sign with the same keystore that you are using in your app.

Answer:

Your key is

8Ioc4p/jMXoU9Lezug4nzmZfFUg

This key is encrypted by your device so you have we have to let this key be known to Facebook user (in your application which you create in Facebook).

Now you have to copy this key in the native app and then save it. After some minutes, you can get all access..

Answer:

The error for me was caused by the mismatch between my debugging key when I was testing my app and the release key when I was signing a release version.

11-02 16:41:31.660: D/Facebook-authorize(13194): Login failed:
invalid_key:Android key mismatch. Your key
“8Ioc4p/jMXoU9Lezug4nzmZfFUg” does not match the allowed keys
specified in your application settings. Check your application
settings at http://www.facebook.com/developers

If you copy and paste 8Ioc4p/jMXoU9Lezug4nzmZfFUg to the Android Key Hash field in the Facebook application settings it should work. If you get this error again (showing a different key value) when you test your signed release version, copy that additional key into the Hash Field after the original entry, so you have two values in there.

I was surprised that more than one entry was allowed in the Key Hash Field, but it appears it is ok and it’s solved the problem for me for both testing and release versions.

Answer:

The debug native Android application key is generated automatically using debug.keystore file located at ~/.android/debug.keystore. When you are developing your application on multiple machines, you should have the same debug.keystore file…

Once this is done, you can paste the debug native Android application key to the Facebook settings page of your application.

Answer:

You actually do not past this key directly, but a Base64 value of this key.

Refer to https://developers.facebook.com/docs/mobile/android/build/#sig which explains you how to generate this.

Answer:

Please check your application page in Facebook and confirm that both keys are same. I think you won’t register your app on Facebook

Answer:

You can use Facebook application in your application so you use this.
In that source code for Facebook integration is there.

Answer:

If the key is invalid, then you have to create the new Facebook application on the Facebook developers site. It provides you with a new key. Use that key in your Facebook demo.

Answer:

I have this problem, I solved it by deleting “C:\Users\user_name.android\debug.keystore” and generating a new one with eclipse. Then I change the old hash key from Facebook and it works!