- Home /
remote_app_id does not match stored id (with different hashes)
I'm working with Unity and Prime31 to build a simple Facebook app. Now I'm trying to run the sample app that comes with Prime31 but I'm getting the following error:
Facebook login failed: remote_app_id does not match stored id
After a lot of research and reading, I try different ways to get my hash key, I try with differents OpenSSL versions with the comand above:
"C:\Program Files\Java\jre7\bin\keytool" -exportcert -alias androiddebugkey -keystore "~/.android/debug.keystore" | "C:\Program Files (x86)\GnuWin32\bin\openssl" sha1 -binary | "C:\Program Files (x86)\GnuWin32\bin\openssl" base64
And I get the following key from the windows console (which don't ask me for a password):
3ZLW/TAqPvR43Zh79ejFQDOdka8=
And if I put that code on my mainactivity:
try {
PackageInfo info = getPackageManager().getPackageInfo(
"com.unity3d.player", 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));
}
I get that hash:
h1e2HgQWtRDA/MDt4LDJTOUQdm8=
With both keys, I got the same error.
It's a sample app, and I think i follow all the steps on the doc, it shouldn't be that hard... :(
Thx for the help, and sorry for my english
Answer by privman · Oct 16, 2013 at 10:35 AM
There are lot of possible causes for this error, and the most common of causes involve using one keystore or alias when calculating the hash and a different keystore/alias when packaging the app. Have a look through the answers in this thread: http://stackoverflow.com/questions/4388992/key-hash-for-android-facebook-app There are quite a few relevant tips there
Answer by jaheroth · Sep 19, 2017 at 03:19 PM
Try first running:
"C:\Program Files\Java\jre7\bin\keytool" -exportcert -alias androiddebugkey -keystore "~/.android/debug.keystore"
What you may find is that you get an error message. In this case, you are getting the hash of this error message, not of the actual data you want. This will obviously result in problems.
I got the exact same hash, when I was adding the hashing ending to something that generated the message:
keytool error: java.lang.Exception: Keystore file does not exist: ~/.android/debug.keystore
Your answer
Follow this Question
Related Questions
Prime31: Posting To Facebook 0 Answers
unity androrid facebook login,user cancelled facebook login problem. 0 Answers
How to make prime31 SocialNetworking plugin demo work? 0 Answers
Finding the “Android class name” in “AndroidManifest.xml” generated by Unity3D 0 Answers
Connect to Android in Unity 1 Answer