Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8529327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:00:45+00:00 2026-06-11T09:00:45+00:00

and thanks in advance for your time and attention! My android app that uses

  • 0

and thanks in advance for your time and attention!
My android app that uses the facebook sdk runs nicely on the emulator, but i get onFacebookError() on both Samsung Galaxy S1 and S2 devices. I wish I could also supply you with more detailed error output information, but I currently do not have those devies at hand to debug on them and check whats going wrong with adb logcat. I know onFacebookError() method is running because of a Toast i put there displaying “onFacebookError”.
Until i manage to get those phones and investigate the errors and post them here, anyone encountered this issue before? When i searched here for this problam I read someone thinks this is because the official facebook app is installed on the devices. Is this relevent?
Toasting e.getMessage() to get the error details like this:

@Override
            public void onFacebookError(FacebookError e) {
                // TODO Auto-generated method stub
                //Toast.makeText(MemoFriendActivity.this, "fbError", Toast.LENGTH_SHORT).show();
                Toast.makeText(MemoFriendActivity.this, "MSG: "+e.getMessage()+ " CODE: "+e.getErrorCode(), Toast.LENGTH_LONG).show();

            }

Displayed this message on S2 devices: “MSG: ivalid_key:Android key mismatch. Your key “XXX” does not match the allowed keys specified in your application settings. Check your application settings at http://www.facebook.com/developers CODE: 0″

Code:

public void onClick(View v) {
    // TODO Auto-generated method stub
    if (MyUtil.fb.isSessionValid())
    {
        //button close session - log out of facebook
        try {
            MyUtil.fb.logout(getApplicationContext());
            updateGuiAccordingToState();
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }   
    }
    else
    {
        //login to facebook
        MyUtil.fb.authorize(this, new DialogListener() {

            @Override
            public void onFacebookError(FacebookError e) {
                // TODO Auto-generated method stub
                Toast.makeText(MemoFriendActivity.this, "fbError", Toast.LENGTH_SHORT).show();

            }

            @Override
            public void onError(DialogError e) {
                // TODO Auto-generated method stub
                Toast.makeText(MemoFriendActivity.this, "OnError", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onComplete(Bundle values) {
                // TODO Auto-generated method stub
                Editor editor = sp.edit();
                editor.putString("access_token", MyUtil.fb.getAccessToken());
                editor.putLong("access_expires", MyUtil.fb.getAccessExpires());
                editor.commit();
                getUsername();
                updateGuiAccordingToState();
            }

            @Override
            public void onCancel() {
                // TODO Auto-generated method stub
                Toast.makeText(MemoFriendActivity.this, "OnCancel", Toast.LENGTH_SHORT).show();
            }
        });
    }
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    MyUtil.fb.authorizeCallback(requestCode, resultCode, data);
}

My.Util.fb is a static Facebook object. Again, this code works on the emulator. Anybody knows how to solve it on a device? I hope I can look it up on a device soon and share.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:00:47+00:00Added an answer on June 11, 2026 at 9:00 am

    Ok, got the answer myself. This is a mismatch of the android key. when running the app from a device instead of the emulator, you need to replace the Hash key that you got on your development PC to the one of the app on the phone has, which you can get from the output of e.getMsg like i showed here. get the key from your device, and set it up as the new Hash in facebook.com/developers. You can also add this hash key in addition to the one you have of your PC in case you want the app to work on both phone and PC. Hope this helps others.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thanks in advance for your time :-) I am working on an MVC3 application
Thanks in advance for your time. I have a deeply nested XML whose XSLT
and thanks in advance for your time. We are using CSLA 3.5.1, although, ultimately,
Firstly thanks in advance for your time looking at this question. I'm trying to
First time asking a question here so thanks in advance for your time. I
Thanks in advance for your time and assistance. I am using Azure Client Library
Thanks in advance for your help. I have a need within an application to
Thanks in advance for your assistance. I have the following exported part: [Export (typeof(INewComponent))]
Thanks in advance for your help experts. I want to be able to copy
Hi thanks in advance for your help. I'm just getting started learning Python and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.