0

I'm using Facebook SDK for Android to integrate Facebook login into my app.
I have installed the SDK 3.0 beta 2. And followed these instructions:

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

It seems to work well, but when I test a sample app, or if I try my own app, in the login screen it says:

"xxx is misconfigured for Facebook login. Press Okay to go back to the application without connecting it to Facebook"

Now I have been going through a lot of threads on stackoverflow, I am not the only person with this problem, but I cannot get it to work. Most people are reporting problems with the key hash. But I have looked up where my key is stored, I have used the keytool command to get my key. And put it in the developer section, and in my app keyhash field. I have also used another solution given here to output to Logcat the key:

Facebook SDK for Android - Example app won't work

This gave me another key a lot longer, I put both keys online but it still doesn't work.

I also activated "ENABLE_LOG" in Util.java, but that never outputs anything.

I am not getting any useful errors in Eclipse.
Would anyone please help me find out what it is wrong ?

Community
  • 1
  • 1
Andrei
  • 1,183
  • 2
  • 19
  • 40
  • have you entered the hash key into your facebook app page??? I mean here https://developers.facebook.com/apps – Atif Farrukh Dec 06 '12 at 17:13
  • yes, both of the keys I found :( – Andrei Dec 06 '12 at 17:43
  • u must get your hash key after siging your application. Hash keys changes after signing. have you done that? – Atif Farrukh Dec 06 '12 at 18:23
  • oh no I haven't done that, will do it. Then the only thing weird is that the sample apps don't work either :s. – Andrei Dec 06 '12 at 18:32
  • yes sample work also worked for me. I dont know why. But after signing its necessary to get hash again according to the alias in which you saved – Atif Farrukh Dec 06 '12 at 18:34
  • I signed the app, and ran it with the alias I entered but it still doesn't work :( I have tried many combinations with the debug alias/app alias, debug.keystore/normal keystore. But it doesn't help in any cases – Andrei Dec 06 '12 at 19:03

1 Answers1

1

Here is the way I did it.

  1. Download openssl-0.9.8e_X64 (the openssl-0.9.8k_X64 won't give you correct hash)
  2. Extract the files.
  3. Open command prompt.
  4. And enter "Location of keytool.exe" exportcert -alias youralias -keystore "location of your app keystore" | "location of your openssl.exe" sha1 -binary | "location of your openssl.exe" base64

    eg "C:\Program Files (x86)\Java\jdk1.7.0_07\bin\keytool" -exportcert -alias atif -keystore "H:\Android\All Aliases\Get Inspired\Get Inspired" | "C:\O pesnSSL\bin\openssl" sha1 -binary | "C:\OpesnSSL\bin\openssl" base64

  5. Copy the hash and paste it in your Facebook app page.

  6. Enjoy the app.
Atif Farrukh
  • 2,219
  • 2
  • 25
  • 47
  • thank you this worked! Quick note it didn't work with my normal keystore, only the debug.keystore. In my case it was password "android" with this: "C:\Program Files (x86)\Java\jdk1.7.0_09\bin\keytool" -exportcert -alias androiddebugkey -keystore "C:\Home\.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary | "C:\OpenSSL\bin\openssl" base64 – Andrei Dec 07 '12 at 06:44