Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Signed APK has different Key-Hash for Facebook

I published my APP and in order to test it, installed the APK on my phone. With the exported APK Facebook doesn't work (wrong keyhash) but with the developer bin'ed apk it works fine.

Can somebody tell me what's going on? Why is the keyhash different? (Second time, eclipse update changed it the first time).

Also

Since I've already uploaded the APK to the market and published it (now unpublished, extremely annoying). Also I've deleted the APK locally so I can't find out the key-hash and I can't download my own app from the market (Tried though Google play, can't cause it's not free). I can't even download the APK from my Google Developer Console (Wtf?). So will I need to upload another version (Say 1.1?) - although my app will new skip the "What's new" section in Google Play which is extremely annoying.

Can anyone suggest what I should do here?

like image 229
Oliver Dixon Avatar asked Dec 15 '22 20:12

Oliver Dixon


1 Answers

The key you sign your app with for distribution is different to the one you use for debugging. The facebook instructions are not clear on this admitedly.

You need to generate the hash against your distribution keystore

keytool -exportcert -alias YOUR_DISTRIBUTION_CERT_NAME -keystore YOUR_DISTRBUTION_KEYSTORE_FILE | openssl sha1 -binary | openssl base64

then add it to your Facebook App Settings over at developers.facebook.com the field for the hash can take multiple hashes (ie. your debug cert and your distribution cert).

like image 114
Pork 'n' Bunny Avatar answered Feb 24 '23 15:02

Pork 'n' Bunny