0

I just started with creation of a simple game with libgdx in android. The application that I amtrying to make can be found here: https://github.com/libgdx/libgdx/wiki/A-simple-game

So I created everything as I was told in tutorials and successfully imported the 5 folders into eclipse. Later on I also created an AVD so I could run my app in it. Here are the settings: https://i.stack.imgur.com/VL4fE.png

NOTE: (Even when I tested to run the app after importing the 5 folders, it didn't work because it should atleast show me the libgdx image and red background).

When AVD opens up it's quite laggy but still works just fine. So I run the application, I get thoose errors in the logcat (and please note that I am a beginner with eclipse and android apps):

04-11 05:43:49.546: D/AndroidRuntime(1092): Shutting down VM
04-11 05:43:49.546: W/dalvikvm(1092): threadid=1: thread exiting with uncaught exception (group=0xb1b0cba8)
04-11 05:43:49.586: E/AndroidRuntime(1092): FATAL EXCEPTION: main
04-11 05:43:49.586: E/AndroidRuntime(1092): Process: com.badlogic.drop, PID: 1092
04-11 05:43:49.586: E/AndroidRuntime(1092): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.badlogic.drop/com.badlogic.drop.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.badlogic.drop.MainActivity" on path: DexPathList[[zip file "/data/app/com.badlogic.drop-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.badlogic.drop-1, /system/lib]]
04-11 05:43:49.586: E/AndroidRuntime(1092):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at android.os.Handler.dispatchMessage(Handler.java:102)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at android.os.Looper.loop(Looper.java:136)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at android.app.ActivityThread.main(ActivityThread.java:5017)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at java.lang.reflect.Method.invokeNative(Native Method)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at java.lang.reflect.Method.invoke(Method.java:515)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at dalvik.system.NativeStart.main(Native Method)
04-11 05:43:49.586: E/AndroidRuntime(1092): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.badlogic.drop.MainActivity" on path: DexPathList[[zip file "/data/app/com.badlogic.drop-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.badlogic.drop-1, /system/lib]]
04-11 05:43:49.586: E/AndroidRuntime(1092):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
04-11 05:43:49.586: E/AndroidRuntime(1092):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
04-11 05:43:49.586: E/AndroidRuntime(1092):     ... 11 more
04-11 05:44:04.046: I/Process(1092): Sending signal. PID: 1092 SIG: 9

If anyone knows how a solution or has any further questions, please let me know about it.

  • Check this If it helps http://stackoverflow.com/questions/24824273/android-class-not-found-didnt-find-class-on-path-dexpathlist-link-of-c – Raghavendra Apr 13 '15 at 09:41

2 Answers2

0

The errors in your logcat say that crash was caused due to the fact the class MainActivity was not found. ("Caused by: java.lang.ClassNotFoundException: Didn't find class "com.badlogic.drop.MainActivity")

In your manifest, you have specified your launcher activity ".MainActivity"

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

Please make sure that the class MainActivity is rightly present in the correct package of your project which is: "com.badlogic.drop".

Devansh Ramen
  • 11
  • 1
  • 2
0

Put this code in your manifest file:

<activity
            android:name=".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>

You got class not found exception check once "com.badlogic.drop.MainActivity" this class present or not. If may happened any alpha character changes.

vijay
  • 1,475
  • 2
  • 16
  • 26