I have an application on production on Play Store which uses a login with the Facebook SDK. When I debug the application from Eclipse there is no problem, but when its on pr
I used this to show the key when I ran my app. In my case, I was getting the incorrect key hash from the keytool command. Notice that if you enter the wrong password(purposely), instead of receiving an error an incorrect key is generated. Use this to get the correct hash and see if it matches the one the in the error log
try {
PackageInfo info = getPackageManager().getPackageInfo("com.package.mypackage", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
String sign=Base64.encodeToString(md.digest(), Base64.DEFAULT);
Log.e("MY KEY HASH:", sign);
Toast.makeText(getApplicationContext(),sign, Toast.LENGTH_LONG).show();
}
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}
Also, if for some reason the above method does not work. Try using this APK to generate the correct key hash. Remember that you have to sign it with whatever certificate you are trying to retrieve(debug or release). Install it on your testing device, and run it.
http://www.easyfacebookandroidsdk.com/download/keyhash.zip