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 9293405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:07:51+00:00 2026-06-18T21:07:51+00:00

I had make FBLogin demo using this tutotial Code is here //MainActivity.java package com.example.fbdemo;

  • 0

I had make FBLogin demo using this tutotial

Code is here
//MainActivity.java

package com.example.fbdemo;
import android.os.Bundle;
import android.app.Activity;
import com.facebook.*;
import com.facebook.model.*;
import android.widget.TextView;
import android.content.Intent;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

      // start Facebook Login
    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() + "!");
              }
            }
          });
        }
      }
    });

}

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

//main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<TextView
    android:id="@+id/welcome"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:text="TextView" />

</RelativeLayout>

//AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.fbdemo"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="8" />

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.fbdemo.MainActivity"
        android:label="@string/app_name" >
         <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name="com.facebook.LoginActivity" />

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/app_id" />
</application>

</manifest>

and Error is this.

02-14 16:40:43.245: E/AndroidRuntime(6300): FATAL EXCEPTION: main
02-14 16:40:43.245: E/AndroidRuntime(6300): java.lang.NoClassDefFoundError:  com.example.fbdemo.MainActivity$1
02-14 16:40:43.245: E/AndroidRuntime(6300):     at com.example.fbdemo.MainActivity.onCreate(MainActivity.java:18)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at android.app.Activity.performCreate(Activity.java:4465)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at android.os.Looper.loop(Looper.java:137)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at android.app.ActivityThread.main(ActivityThread.java:4424)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at java.lang.reflect.Method.invokeNative(Native Method)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at java.lang.reflect.Method.invoke(Method.java:511)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-14 16:40:43.245: E/AndroidRuntime(6300):     at dalvik.system.NativeStart.main(Native Method)

please give me solution.

  • 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-18T21:07:52+00:00Added an answer on June 18, 2026 at 9:07 pm

    The android:name=”.MainActivity” is not the problem. That is just a shorthand notation for what you have in your Manifest right now (meaning: the MainActivity class in the default package, which is already com.example.fbdemo).

    Actually from your logging you can see that it is not MainActivity class that cannot be found, but com.example.fbdemo.MainActivity$1. The $1 means something like (give me some rope here) “the first anonymous inner class that you have in MainActivity”. From your code I think it it safe to assume that class is Session.StatusCallback() that you new in your call to Session.openActiveSession().

    I don’t know this class, but is it from a library? If that is the case, are you linking the .jar file of this library in the correct way? It should be in the ‘libs’ directory of you project. In that case it should get deployed along with your app. If you just referred to it, it will only be available at compile time (hence the compiler will not complain), but Android’s packaging step will not include it in the .apk file.

    Hope this helps.

    [edit]Of course I may be wrong with the $1 resolving to Session.StatusCallback(). It may also be resolving to Request.GraphUserCallback(), which is another one of those “anonymous inner classes” in your code. You will have to play around a bit. Maybe it will even be both ;-)[/edit]

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

Sidebar

Related Questions

I've had trouble writing this code. I'm supposed to make a function that can
I have been using an open source Java project and had to make some
I recently had an idea to create my own String class to make using
Just wondering if you had any thoughts on this problem. I want to make
Hello everyone I have this problem, I had to make a AsyncTask because the
I had make an Button Style as DataTemplate in a ResourceDictionary. Here a small
I'm trying TCC under OS X. I had to make some modifications following this
this question might sound silly to some but i just had to make sure.
So i had to make a quicksort algorithm using pivot as the middle element
I have a newbie Java question. I had to make suite of J/DBUnit tests

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.