机器人/实 - INVALID_KEY设备上,但不能在模拟器 [英] Android/Facebook - invalid_key on device, but not on emulator

查看:396
本文介绍了机器人/实 - INVALID_KEY设备上,但不能在模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用下面获得密钥我的Andr​​oid / Facebook应用程序:

I obtained a key for my Android/Facebook app using the following:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

我给了这对Facebook和应用程序现在的作品完美的模拟器内,既没有安装Facebook应用程序。然而,当我打包应用程序,并把它放在我的手机(HTC Desire的),我进行身份验证时得到INVALID_KEY错误。任何人都可以解释为什么发生这种情况的光?我是否需要使用不同的密钥?

I gave this to Facebook and the app now works perfectly within the emulator, both with and without the Facebook app installed. However, when I packaged the app and put it on my phone (HTC Desire), I get the invalid_key error when authenticating. Could anyone shed any light on why this is happening? Do I need to use a different key?

推荐答案

是...您需要使用您使用的实际编制应用程序,否则不匹配(即您在出口过程中使用的)相同的密钥。

yes... you need to use the same key you use for actually compiling the app (the one that you use in the export process) otherwise it mismatches.

这是一个(小)PITA,你需要让他们无论在手,掉出来,这样,当你正在调试你使用一个,当你真正编译的apk您使用其他。

It's a (small) PITA, you need to keep them both on hand and swap them out, so that when you're debugging you're using one and when you actually compile your apk you use the other.

我已经得到了成刚迅速编制我的APK,并使用亚行安装/卸载它到我的连接的设备的习惯,所以,我不与调试版本打扰在所有...但如果​​你preFER你可以只保留交换出来Facebook应用程序编辑页面上。

I've gotten into the habit of just quickly compiling my apk and using adb to install/uninstall it onto my attached device, so, I don't bother with the debug version at all... but if you prefer you can just keep swapping them out on the Facebook App editor page.

这篇关于机器人/实 - INVALID_KEY设备上,但不能在模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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