Android Facebook SDK 3.0 gives "remote_app_id does not match saved id" at login

I am trying to create an application using the Facebook SDK for Android 3.0. But when I try to call

Session.openActiveSession 

This just gives me a SessionState with CLOSED_LOGIN_FAILED, and LogCat:

 12-16 00:03:40.510: W/fb4a:fb:OrcaServiceQueue(4105): com.facebook.orca.protocol.base.ApiException: remote_app_id does not match stored id 

I searched StackOverflow with “remote_app_id” and the results are the Bundle ID in iOS, but I don't know what “remote_app_id” means in Android. I already set the package name and activity name in the settings of my Facebook application. I do not know the cause of the error.

+43
android facebook facebook-android-sdk
Dec 15 '12 at 16:30
source share
7 answers

I have resolved this issue. The problem is that the “Key Hash” that I generated using the “keytool” was incorrect. When "keytool" asks for a password, you should use "android" for it (without quotes). Instead, I used my own password. When I changed my password, the problem just flew away. Hope this helps.

+34
Dec 16 '12 at 1:50
source share

Another possible mistake (which happened to me) is this: create a “Hash Key” in the Facebook App Console and sign the Android application using another keystore.

Unfortunately, this is because Facebook Getting Started Tutorial is causing this error. It says that Android developers should use the standard debug key for Android in your examples and do not explain that the key hash should be generated with the same keystore that you sign in your application.

My recommendation is to set up two hash keys on your facebook console:

  • standard debug key for Android:

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

  1. your application key:

keytool -exportcert -alias yourappreleasekeyalias -keystore ~ ​​/.your/path/release.keystore | openssl sha1 -binary | openssl base64

Remember: you cannot publish an application signed with the debug key generated by the SDK tools. Thus, it is not possible to publish the application using only the hash key generated using the first previous command line (as the facebook tutorial suggests.

For more information about signing your application, visit Signing Your Application .

+77
Dec 26 '12 at 14:34
source share

Another option is to print the key hash code sent to Facebook and use this value.

Make the following changes to the onCreate() method in your main action:

 try { PackageInfo info = getPackageManager().getPackageInfo( "com.facebook.samples.loginhowto", PackageManager.GET_SIGNATURES); for (Signature signature : info.signatures){ MessageDigest md = MessageDigest.getInstance("SHA"); md.update(signature.toByteArray()); Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT)); } } catch (NameNotFoundException e) { } catch (NoSuchAlgorithmException e) { } 

Replace com.facebook.samples.loginhowto with your own package name .

It worked for me!

+61
Jan 20 '13 at 2:53
source share

I fell into the trap of the wrong openssl that generated the wrong hash key. I used openssl from http://gnuwin32.sourceforge.net/packages/openssl.htm , which solved the problem.

+5
Apr 17 '13 at 12:17
source share

I had the same problem, it turned out that openssl was creating the wrong sha1. downloaded a new one and it worked like a charm.

+4
Feb 16 '13 at 2:53 on
source share

Also, make sure you enter the hash in the right place on the facebook dev portal. Edit the application settings and select "Natural Android Application".

I mistakenly put the hash in the "Application Settings Example".

0
Apr 21 '13 at 22:54
source share

You get a hash key with a debug key ... What can work if you do not sign the package and run the application in debug mode. What you need to do:

1) Go to the manifest file and add to the android application: debuggable = "true".

2) Now run the application and check the logarithm.

3) You will receive a printout of the new key that will match the keyword with x9SLcMXBlgly1f36PJuuc4a3YAc. The key that you have now has an "=" sign in the last.

4) Register this key on the developer's site on the site

Alternative trick

You can do one more thing. Just register this key on the facebook developers website. x9SLcMXBlgly1f36PJuuc4a3YAc =

Just add = to the key that is displayed by facebook.

you are done !! Hope this works.

0
Jul 30 '14 at 11:22
source share



All Articles