invalid key hash. the key hash does not match any stored key hashes facebook android

故事扮演 提交于 2019-11-30 10:58:52

I have solved my problem :D

So to have the release key hash, you need to install the apk file in your Android emulator, and add the key generated by the following code to your Facebook app:

try {
            PackageInfo info = getPackageManager().getPackageInfo(
                    "com.org.package", 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);

            }
        } catch (NameNotFoundException e) {
        } catch (NoSuchAlgorithmException e) {
        }

Good luck!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!