1

I have gone through the tutorials on developer.facebook.com for basic hello world facebook app for android countless times to make sure im not making a mistake but I get the error "remote_app_id does not match stored id" but it does match and not sure why it is throwing that error. Also when i run the samples i get a failed binder transaction. Now whats strange is if i uninstall the fb app on my phone and force the user to sign in to facebook the basic hello world app works. Am I doing something wrong or is this a facebook sdk problem. I have already downloaded and reinstalled everything but still getting the same problem

3 Answers 3

2

Another possible error (which happened to me) is: to set up a "Key Hash" at Facebook App Console and to sign the android app using another keystore.

Unfortunately this is caused because Facebook Getting Started Tutorial induces this error. It says that android developers should use default android debug key in your examples and doesn't explain that the Key Hash should be generated with the same keystore you will sign your application.

My recomendation is to set up two Key Hashes at your facebook console:

  1. default android debug key:

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

  1. your application release key:

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

Remember: you cannot publish an application that is signed with the debug key generated by the SDK tools. So it isn't possible to publish an app using only the hash key generated using the first previous command line (as facebook tutorial suggests.

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

2

try

try {
PackageInfo info = getPackageManager().getPackageInfo("com.eatapp", 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) {

}

in your main Activity :-) This is the only solution it works for me for Android SDK 3.0

1

SOLVED.

The hash value was wrong. It seems to be a windows problem or failure on human end. I used:

"location of keytool.exe" -exportcert -alias alias -keystore "location of keystore" | "location of openssl.exe" sha1 -binary | "location of openssl.exe" base64

and got the wrong hash value. Anyways found this post

http://p-xr.com/implementing-facebook-into-your-app-invalid-key-with-keytool/

downloaded and ran the keygeneration application and got the hash value out of the logcat. This is great for debug key but unsure about when releasing your program out into the wild

Hope this helps

1
  • 1
    if you use the snippet change Log.i("PXR", Base64.encodeToString(md.digest(), 0)); Dec 17, 2012 at 21:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.