Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
454 views
in Technique[技术] by (71.8m points)

android - remote_app_id does not match stored id - exception

i am using the facebook native login and i get the CLOSED_LOGIN_FAILED .

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 : []

i get the keyhash using

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

where "c:documents and settingsDroid 4.androiddebug.keystore" is my keystore path and C:openssl-0.9.8g_win32inopenssl is my openssl path

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

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 .

Thanks in advance .

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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) {

    }

paste it in onCreate


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...