remote_app_id 与存储的 ID 不匹配 - 异常 [英] remote_app_id does not match stored id - exception
问题描述
我正在使用 facebook 本地登录,我得到了 CLOSED_LOGIN_FAILED .
i am using the facebook native login and i get the CLOSED_LOGIN_FAILED .
以下是我在DDMS中得到的LogCat,
The following is the LogCat i get in DDMS ,
02-22 15:16:22.939: E/exception(4583): is null
02-22 15:16:22.939: E/session(4583): is {Session state:OPENING, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:420081348034777}
02-22 15:16:22.939: E/state(4583): is OPENING
02-22 15:16:51.749: E/exception(4583): is com.facebook.FacebookOperationCanceledException: remote_app_id does not match stored id
02-22 15:16:51.749: E/session(4583): is {Session state:CLOSED_LOGIN_FAILED, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:420081348034777}
02-22 15:16:51.749: E/state(4583): is CLOSED_LOGIN_FAILED
02-22 15:16:51.749: E/if logged in is(4583): true : false
02-22 15:16:51.749: E/if logged in is(4583): exception : com.facebook.FacebookOperationCanceledException: remote_app_id does not match stored id
02-22 15:16:51.749: E/if logged in(4583): premissions : []
我使用
C:Program FilesJavajre6in>keytool -exportcert -alias androiddebugkey -keystore "c:documents and settingsDroid 4.androiddebug.keystore" | C:openssl-0.9.8g_win32inopenssl sha1 -binary | C:openssl-0.9.8g_win32inopenssl base64
其中 "c:documents and settingsDroid 4.androiddebug.keystore"
是我的密钥库路径而 C:openssl-0.9.8g_win32inopenssl
是我的 openssl 路径
where "c:documents and settingsDroid 4.androiddebug.keystore"
is my keystore path
and C:openssl-0.9.8g_win32inopenssl
is my openssl path
这就是我如何通过 Eclipse 获取使用它的密钥以及我创建的密钥库,
this is how i get the key for using it through eclipse and for the keystore i create ,
C:Program FilesJavajre6in>keytool -exportcert -alias mykeystorename -keystore "D:Appsmykeystorepath" | C:openssl-0.9.8g_win32inopenssl sha1 -binary | C:openssl-0.9.8g_win32inopenssl base64
这是我用来获取我的密钥哈希的命令,使用我为发布而创建的 kaystore 签名.
this is the command i use for getting my keyhash , signing with the kaystore i created for publishing .
我不知道我哪里出错了,我已经尝试了所有相关的线程,但没有成功.
i dont know where i am going wrong , i have tried through all the related threads and i was not successful .
提前致谢.
推荐答案
使用这段代码是因为更可靠,我尝试了许多版本的 openssl 但都没有成功.
Use this piece of code because is more reliable, i tried many versions of openssl but with no success.
try {
PackageInfo info = getPackageManager().getPackageInfo("your.package",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("YOURHASH KEY:",
Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}
粘贴到 onCreate
paste it in onCreate
这篇关于remote_app_id 与存储的 ID 不匹配 - 异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!