Reputation: 728
I obtained a key for my Android/Facebook app using the following:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
I gave this to Facebook and the app now works perfectly within the emulator, both with and without the Facebook app installed. However, when I packaged the app and put it on my phone (HTC Desire), I get the invalid_key error when authenticating. Could anyone shed any light on why this is happening? Do I need to use a different key?
Upvotes: 1
Views: 705
Reputation: 28349
yes... you need to use the same key you use for actually compiling the app (the one that you use in the export process) otherwise it mismatches.
It's a (small) PITA, you need to keep them both on hand and swap them out, so that when you're debugging you're using one and when you actually compile your apk you use the other.
I've gotten into the habit of just quickly compiling my apk and using adb to install/uninstall it onto my attached device, so, I don't bother with the debug version at all... but if you prefer you can just keep swapping them out on the Facebook App editor page.
Upvotes: 1