I have gone through the tutorials on developer.facebook.com for basic hello world facebook app for android countless times to make sure im not making a mistake but I get the
SOLVED.
The hash value was wrong. It seems to be a windows problem or failure on human end. I used:
"location of keytool.exe" -exportcert -alias alias -keystore "location of keystore" | "location of openssl.exe" sha1 -binary | "location of openssl.exe" base64
and got the wrong hash value. Anyways found this post
http://p-xr.com/implementing-facebook-into-your-app-invalid-key-with-keytool/
downloaded and ran the keygeneration application and got the hash value out of the logcat. This is great for debug key but unsure about when releasing your program out into the wild
Hope this helps
try
try {
PackageInfo info = getPackageManager().getPackageInfo("com.eatapp", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.e("MY KEY HASH:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}
in your main Activity :-) This is the only solution it works for me for Android SDK 3.0
Another possible error (which happened to me) is: to set up a "Key Hash" at Facebook App Console and to sign the android app using another keystore.
Unfortunately this is caused because Facebook Getting Started Tutorial induces this error. It says that android developers should use default android debug key in your examples and doesn't explain that the Key Hash should be generated with the same keystore you will sign your application.
My recomendation is to set up two Key Hashes at your facebook console:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
keytool -exportcert -alias yourappreleasekeyalias -keystore ~/.your/path/release.keystore | openssl sha1 -binary | openssl base64
Remember: you cannot publish an application that is signed with the debug key generated by the SDK tools. So it isn't possible to publish an app using only the hash key generated using the first previous command line (as facebook tutorial suggests.
For more information about signing your application, visit Signing Your Application.