eclipse - Android FB login app - invalid key hash -
I have this problem, I'm making Java in Eclipse with FB SDK Android. When I debug and run this app in the Android emulator, I can logout. But when I export the app to develop version (.apec), and install it on my phone or genomotion emulator, I get these errors:
"Hem Vime Hashes has any stored key that does not match the hash xxxxxxxxxxxxxxxxxxx. Configure your app key hash at http://developers.facebook.com/apps/72012084472886 "The hack key is making correoct I use it: Try {PackageInfo info = getPackageManager (). GetPackageInfo ("com.facebook.samples.hellofacebook", PackageManager.GET_SIGNATURES); (Signature signature: info.ignatures) (MessageDigest md = MessageDigest.getInstance ("SHA"); md.update (signature.toByteArray ()); Log D. ("keyhash:", base 64.exodontostring (MD. Digit (), Base 64. Default));} Hold (NameNotFoundException E) {} Hold (NoSuchAlgorithmException E) {} Do you have any ideas, what is wrong? < / P>
Thank you. debug.keystore , this main stystem is usually the one you want to answer. When you export your app and make a keystore, the keyship value changes because you change the keystore.
You can apply this code to your code So that you can echo the keyships to Stresses: Public Static Zero Printer (reference pContext) {{PackageInfo info = getPackageInfo (pContext, PackageManager.GET_SIGNATURES); (Signature signature: info. signatures) {message digest Muddy = MessageDigest.getInstance ( "SHA"); Md.update (signature.toByteArray ()); String hash = new string (base 64. encode (md.digest (), 0)); Logs. I (tag, "print hash () hash key:" + hashki); }} Hold (Knowledge Algorithm Execution E) {Log. A (tag, "printhashke ()", e); } Hold (exception e) {log. A (tag, "printhashky ()", e); }} The snippet is only suitable for development, not for production!
Comments
Post a Comment