使用发布密钥哈希为 Facebook 登录配置错误的应用程序 [英] App is misconfigured for Facebook Login with Release Key Hash

查看:35
本文介绍了使用发布密钥哈希为 Facebook 登录配置错误的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将 Facebook 集成到我的应用中.我在模拟器和我的设备 HTC 中使用调试密钥哈希测试了我的应用程序.当我为我的签名 APK 尝试发布密钥哈希时,我的设备 HTC One X 中总是发生应用程序配置错误以用于 Facebook 登录"错误.

I've intergrated Facebook to my App. I tested my App with Debug Key Hash was alright in emulator and my device HTC. When I tried the Release Key Hash for my signed APK , "App is misconfigured for Facebook login" error always happened in my device HTC One X.

keytool -exportcert -alias android -keystore C:android2012android.keystore |openssl sha1 -binary |openssl base64

我使用上面提到的命令来生成发布密钥哈希.别名是android".输入密码后成功生成密钥哈希.此密钥哈希已输入 Facebook 仪表板,我尝试在已签名的 APK 中访问,但失败了.

I used the above-mentioned command to generate the Release key hash. The alias name is "android". It successfully generated the key hash after entering password. This key hash was input into the Facebook Dashboard and I tried to access in my signed APK but it failed.

有人可以帮忙吗?被这个错误困了几天.非常感谢!

Anyone can help? Stuck with this error for few days. Thanks a lot!

推荐答案

为什么它可以在模拟器上运行,甚至在您测试时在设备上运行是因为,在 eclipse 中进行测试时,您使用了 debug.keystore 而不是你的释放键.

Why it works on the emulator or even on the device while you are testing it is because, while testing from eclipse, you use the debug.keystore and not your release key.

遵循以下两种解决方案之一,您应该就可以开始了.

Follow one of the two solutions below, and you should be good to go.

解决方案 1:

试试这个链接:http://www.helloandroid.com/tutorials/using-facebook-sdk-android-development-part-1.我发现使用 Facebook 获取哈希键的方法并不总是像宣传的那样有效.但是,此链接具有不同的获取哈希键的方法,并且几乎一直有效.

Try this link: http://www.helloandroid.com/tutorials/using-facebook-sdk-android-development-part-1. I found that using the Facebook method of getting a Hash Key did not always work as advertised. This link however, has a different method of getting the Hash Key and has pretty much always worked.

解决方案 2:

话虽如此,我总是发现要做的最简单的事情是,让 Facebook SDK 告诉您您的哈希键是什么.这要简单得多,而且不会超过几分钟.

That being said, I always found the simplest thing to do was, let the Facebook SDK tell you what your Hash Key is. This is by far more simpler and shouldn't take more than a couple of minutes.

第 1 步:在您的 Facebook SDK 中,找到 Util.java 类.在那,改变这个:

Step 1: In your Facebook SDK, locate the Util.java class. In that, change this:

private static boolean ENABLE_LOG = false;

到:

private static boolean ENABLE_LOG = true;

第 2 步:创建一个签名的 APK,传输到您的设备并安装.如果已经安装了,自然会提示.

Step 2: Create a new Signed APK, transfer to your device and install. If it is already installed, naturally, it will prompt.

第 3 步:在您的 DDMS (Logcat) 运行且您的设备连接到计算机的情况下,运行应用程序并继续寻找密钥不匹配警告.该警告具有实际哈希键.复制该密钥,转到您的 Facebook 开发者页面并将新密钥添加到列表中.

Step 3: With your DDMS (Logcat) running and your device connected to the computer, run the application and keep looking for a key mismatch warning. That warning has the actual Hash Key. Copy that key, go to your Facebook Developer page and add the new key to the list.

这篇关于使用发布密钥哈希为 Facebook 登录配置错误的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆