I\'m trying to use Facebook Android SDK to develop a simple app with the Facebook Login Button. But i\'m having trouble with Key Hashes. I\'ve created both a debug key and a
When you get Invalid key hash, it also shows the correct key hash and says "The keyhash XXXXX didnot match with any of the stored keyhashes" . so copy that displayed keyhash and append "=" at the end as XXXXX= and add it in the key hash section. Hope it works....
this might also work
public static void showHashKey(Context context) {
try {
PackageInfo info = context.getPackageManager().getPackageInfo(
"com.example.me", PackageManager.GET_SIGNATURES); //Your package name here
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.i("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}
}