0

I'm trying very simply to test the 3.0 Facebook get started guide. https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/

I have had some problems with imports and references but I don't know it that's relevant. The issue I'm having is when I try to run the test Activity ant get this error:

Could not find class 'com.test1.test2.FacebookLogin$1', referenced from method com.test1.test2.FacebookLogin.onCreate

Code:

 @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_facebook_login);


        //Error occurs here when I use 'this'
        Session.openActiveSession(this, true, new Session.StatusCallback() {

          // callback when session changes state
          @Override
          public void call(Session session, SessionState state, Exception exception) {
              if (session.isOpened()) {

                // make request to the /me API
                  Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {

                    // callback after Graph API response with user object
                    @Override
                    public void onCompleted(GraphUser user, Response response) {
                        if (user != null) {
                              TextView welcome = (TextView) findViewById(R.id.welcome);
                              welcome.setText("Hello " + user.getName() + "!");
                            }

                    }
                  });

              }
          }
        });
    }

How can I get a NoClassDefFoundError when I use this?

UPDATE:

After testing with the Scrumtious tutorial https://developers.facebook.com/docs/tutorials/androidsdk/3.0/scrumptious/authenticate/ as well I'm getting the same error when I call the Session.StatusCallback() method. I still don't know what my problem is though.

Thanks for the help

PaperThick
  • 2,749
  • 4
  • 24
  • 42
  • May this help : http://stackoverflow.com/questions/8678630/noclassdeffounderror-android – Alexis C. May 20 '13 at 11:39
  • It seems like you are also using `super` and not just `this` – Rahul Bobhate May 20 '13 at 11:41
  • @ZouZou Thanks but no I did not – PaperThick May 20 '13 at 11:46
  • FacebookLogin$1 means it is annonymous class in facebooklogin, maybe Session.StatusCallback? is it part of facebook api? do you uploading it to your android device? – user902383 May 20 '13 at 12:05
  • @user902383 Yes that seems to be some of the issue. I tried with the Scrumptious test app now and getting the same error when new Session.StatusCallback() is called, do you ave any clue what it could be, and yes I upload it to my device. Thanks – PaperThick May 20 '13 at 12:38

1 Answers1

0

Maybe you updated to Android sdk tools revision 22. There is an issue there. You have to add the libraries you use in the export path. Check:
Android Sdk tools Revision 22 issue?

Community
  • 1
  • 1
Thomas Kaliakos
  • 3,274
  • 4
  • 25
  • 39