Search code examples
androidfacebook-sdk-3.0

Android still: remote_app_id does not match stored id


Sorry make more 1 post about this, but the existent ones didnt help my case. I know it must be something simple but I really cant find the mistake. I'am trying connect my android app in facebook unsing facebook sdk but got error:

remote_app_id does not match stored id

Lot of people have this problem and solve it easely fixing the key hashes. But in my case still dont work. Some informations:

1) I collect the debug key-hash from app using the code:

PackageInfo info = getPackageManager().getPackageInfo(
                    "com.MYAPPPACKAGE.MYAPPNAME", 
                    PackageManager.GET_SIGNATURES);

I check the package name (and this code doesnt work with the wrong one) so I trust the key hash here is right. For desperate I still left the key hash generate from jre6 and jre7 keytool. Still dont work.

2) In facebook settings I put:

package name: Just like found in manifest.

class name: Just like found in manifest main activity. (copy both using copy past for avoid typo);

facebook login: active;

3) I check the app_id string and it is ok.

4) The java code. Simple sample:

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
}   

and:

private void                            testFacebook() {
    Log.e("TF","testFacebook");
    Session.openActiveSession(this, true, new Session.StatusCallback() {            

        @Override
        public void call(Session session, SessionState state, Exception exception) {

            if (session.isOpened()) {
                Log.e("TF","session is open");
            }
            else {
                Log.e("TF","Session not open");
            }
        }
    });
}       

Another thing: There is a facebook.apk installed in device. I tried let the test as simple as possivel and it still doest work. Someone knows what I am doing wrong? All posts I found about the "remote_app_id does not match stored id" has solved fixing the key hash, but the key get from app by GET_SIGNATURES should be the right one, right?

Thank you!


Solution

  • I found it. That was really a stupid mistake. In one of my translated strings.xml the app_id was wrong. I checked the app_id but not in this file. Thank you!