Akash Deshpande
Akash Deshpande

Reputation: 2645

Facebook android hash key error while logging in

I have created a simple android app and signed it using the Eclipse export method.

Then I use the export cert command of keytool.

keytool -exportcert -alias my_alias -keystore "G:\mypath\app\android.keystore"|"C:\ssl\bin\openssl" sha1 -binary |"C:\ssl\bin\openssl" base64

I got some "hash code". I added this hash code to the facebook panel for native android app and checked the login with facebook. While logging in, facebook gives and error stating that the hash code of the app is not allowed. i.e. is not given on the list of allowed has codes.

What am I doing wrong ? Is the question clear ? Please comment I will make the necessary changes.

Upvotes: 0

Views: 2343

Answers (2)

James Pearce
James Pearce

Reputation: 2332

Ideally you add the key hash to two places:

  • your overall developer settings (so that you can run the Facebook samples)

  • the settings for each of your apps themselves

These are described in steps 4 & 5 of the Getting Started guide, respectively: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/

Make sure you have done both.

Upvotes: 3

Ruben Pizarro
Ruben Pizarro

Reputation: 73

Hmmm. Sound like a mismatch of the android key. When running your app from a device (not the emulator) you need to replace the Hash key that you got on your development PC with the one on the app. Get the key from your device and go to facebook.com/developers.

Upvotes: 1

Related Questions