Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Android SDK Invalid_key [duplicate]

Possible Duplicate:
Login failed invalid key error with Facebook SDK

I am using a sample app for here ibm.com/developerworks/library/x-androidfacebookapi/ to test facebook android SDK, I have given my APP ID in this sample app. I have done all setups and prerequisites. I have signed app with my keystore and generated hash key I submitted hash key to facebook app settings page, I installed facebook app on my device. But after all doing the app gives Facebook error invalid_key. Pls help me in this regards, Thank you.

like image 430
om252345 Avatar asked Dec 20 '10 12:12

om252345


3 Answers

Invalid Key could be for a number of reasons -

  1. Make sure you have Keytool and OpenSSL installed.
  2. Make sure you are giving the correct Keystore file in the command.
  3. Make sure you are giving the correct Alias.
  4. Make sure you copied the generated Hash Key correctly to the Facebook application correctly.

When I got Invalid Key initially, it was because I was giving the wrong Alias. The strange thing is, that Keytool and OpenSSl won't mention that the alias is wrong. If you give the command to generate the Hash Key, and it doen't ask you for your password, you're probably doing it wrong.

like image 174
Abhinav Manchanda Avatar answered Nov 09 '22 13:11

Abhinav Manchanda


After a few days of struggling with the same issues, I wrote up a full explanation of the problem and the various fixes here:

http://sean.lyn.ch/2011/07/android-the-facebook-sdk-sso-and-you/

like image 28
Sean Lynch Avatar answered Nov 09 '22 13:11

Sean Lynch


A few things I ran into before I got this working:

1) Generate your hash in linux. Windows (at least for me, 64-bit) didn't generate the correct hash. Download the Cygwin bash shell and do it from there.

2) In the filepath for the keystore, everything should be a forward slash. Even in front of C:. So, for example, C:/Users/YourName/.android/debug.keystore, NOT C:\Users/YourName/.android/debug.keystore.

3) The equals at the end of the hash should be included. Maybe this was obvious to some people, but nevertheless I thought I should mention it.

It SHOULD prompt you for a password. If it doesn't, you've done something incorrectly.

like image 20
Seth Nelson Avatar answered Nov 09 '22 12:11

Seth Nelson