Android的Facebook的remote_app_id不匹配存储ID错误不匹配、错误、Facebook、Android

2023-09-12 03:25:45 作者:没有你的曾经并不是回忆

在我的应用程序的用户必须通过Facebook登录,但是我得到这个错误,

In my application user have to login via facebook, but i am getting this error,

**my logcat error:**

02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988): Exception during service
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988): com.facebook.orca.protocol.base.ApiException: remote_app_id does not match stored id 
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at com.facebook.orca.protocol.base.ApiResponseChecker.b(ApiResponseChecker.java:74)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at com.facebook.orca.protocol.base.ApiResponseChecker.a(ApiResponseChecker.java:103)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at com.facebook.orca.protocol.base.ApiResponse.g(ApiResponse.java:208)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:267)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:28)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at com.facebook.orca.protocol.base.SingleMethodRunner.a(SingleMethodRunner.java:125)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at com.facebook.katana.server.handler.PlatformOperationHandler.c(PlatformOperationHandler.java:274)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at com.facebook.katana.server.handler.PlatformOperationHandler.a(PlatformOperationHandler.java:175)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at com.facebook.orca.server.OrcaServiceQueue.d(OrcaServiceQueue.java:218)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at com.facebook.orca.server.OrcaServiceQueue.d(OrcaServiceQueue.java:38)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at com.facebook.orca.server.OrcaServiceQueue$3.run(OrcaServiceQueue.java:169)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at android.os.Handler.handleCallback(Handler.java:587)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at android.os.Handler.dispatchMessage(Handler.java:92)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at android.os.Looper.loop(Looper.java:123)
02-14 18:00:01.821: WARN/fb4a:fb:OrcaServiceQueue(10988):     at android.os.HandlerThread.run(HandlerThread.java:60)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988): Failed to send
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988): com.facebook.orca.ops.ServiceException: API_ERROR: API_ERROR
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at com.facebook.orca.ops.OrcaServiceOperation.c(OrcaServiceOperation.java:610)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at com.facebook.orca.ops.OrcaServiceOperation.c(OrcaServiceOperation.java:40)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at com.facebook.orca.ops.OrcaServiceOperation$2.run(OrcaServiceOperation.java:575)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at android.os.Handler.handleCallback(Handler.java:587)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at android.os.Handler.dispatchMessage(Handler.java:92)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at android.os.Looper.loop(Looper.java:123)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at android.app.ActivityThread.main(ActivityThread.java:3687)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at java.lang.reflect.Method.invokeNative(Native Method)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at java.lang.reflect.Method.invoke(Method.java:507)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
02-14 18:00:01.876: WARN/fb4a:fb:GDPDialog(10988):     at dalvik.system.NativeStart.main(Native Method)

像这样

我创建散列键,

i'm creating hash key like this,

keytool -exportcert -alias androiddebugkey -keystore "C:\Users\rama\.android\debug.keystore" | "C:\openssl-0.9.8k_X64\bin\openssl" sha1 -binary | "C:\openssl-0.9.8k_X64\bin\openssl" base64

我有钥匙,然后加入Facebook的设置。

i got key then added to facebook setting.

给我一些好主意,这样,

give me some good idea to this,

感谢。

推荐答案

在应用程序中的主要活动,在OnCreate(),把这个code和运行应用程序。

In the main Activity of your application, in the onCreate(), put this code and run the app.

这会给你所需要的Facebook正确的密钥散列。显然,JRE 1.7确实是偶尔为之。

This will give you the correct Key Hash that is needed by Facebook. Apparently, JRE 1.7 does that occasionally.

复制将被显示在logcat的跟踪,并在你的应用程序的Facebook控制台粘贴的结果,你应该是好去。

Copy the result that will be displayed in the logcat trace and paste in your App's Facebook console and you should be good to go.

try {
    PackageInfo info = getPackageManager().getPackageInfo(
            "ENTER.YOUR.PACKAGE.NAME", PackageManager.GET_SIGNATURES);
    for (Signature signature : info.signatures) {
        MessageDigest md = MessageDigest.getInstance("SHA");
        md.update(signature.toByteArray());
        Log.e("MY KEY HASH:",
                Base64.encodeToString(md.digest(), Base64.DEFAULT));
    }
} catch (NameNotFoundException e) {

} catch (NoSuchAlgorithmException e) {

编辑:差点忘了。 不要忘了与你的应用程序的包名替换 ENTER.YOUR.PACKAGE.NAME 。 ; - )

Almost forgot. Don't forget to replace the ENTER.YOUR.PACKAGE.NAME with your app's package name. ;-)

更新:

解决方案1:

尝试此链接:http://www.helloandroid.com/tutorials/using-facebook-sdk-android-development-part-1.我发现,使用得到一个哈希键的Facebook的方法并不总是工作作为标榜。这个环节却拥有获得散列键不同的方法,并有pretty的多一直工作。

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.

第三步:用你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.