Listing 9.13: App crashes after trying to run criminalintent


#1

(EDIT: My particular problem was solved by user rcubed)

Hi all.
I’m using my actual phone to run criminalintent. After declaring CrimeListActivity in the manisfest (Listing 9.13) and pressing run, the app crashes. “Unfortunately, criminalIntent has stopped”

Here is the error message from logcat

09-07 16:54:36.640: D/AndroidRuntime(21983): Shutting down VM 09-07 16:54:36.640: W/dalvikvm(21983): threadid=1: thread exiting with uncaught exception (group=0x418bdda0) 09-07 16:54:36.640: E/AndroidRuntime(21983): FATAL EXCEPTION: main 09-07 16:54:36.640: E/AndroidRuntime(21983): Process: com.joegathu.criminalintent, PID: 21983 09-07 16:54:36.640: E/AndroidRuntime(21983): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.joegathu.criminalintent/com.joegathu.criminalintent.CrimelistActivity}: java.lang.ClassNotFoundException: Didn't find class "com.joegathu.criminalintent.CrimelistActivity" on path: DexPathList[[zip file "/data/app/com.joegathu.criminalintent-18.apk"],nativeLibraryDirectories=[/data/app-lib/com.joegathu.criminalintent-18, /vendor/lib, /system/lib]] 09-07 16:54:36.640: E/AndroidRuntime(21983): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231) 09-07 16:54:36.640: E/AndroidRuntime(21983): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363) 09-07 16:54:36.640: E/AndroidRuntime(21983): at android.app.ActivityThread.access$900(ActivityThread.java:161) 09-07 16:54:36.640: E/AndroidRuntime(21983): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265) 09-07 16:54:36.640: E/AndroidRuntime(21983): at android.os.Handler.dispatchMessage(Handler.java:102) 09-07 16:54:36.640: E/AndroidRuntime(21983): at android.os.Looper.loop(Looper.java:157) 09-07 16:54:36.640: E/AndroidRuntime(21983): at android.app.ActivityThread.main(ActivityThread.java:5356) 09-07 16:54:36.640: E/AndroidRuntime(21983): at java.lang.reflect.Method.invokeNative(Native Method) 09-07 16:54:36.640: E/AndroidRuntime(21983): at java.lang.reflect.Method.invoke(Method.java:515) 09-07 16:54:36.640: E/AndroidRuntime(21983): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265) 09-07 16:54:36.640: E/AndroidRuntime(21983): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) 09-07 16:54:36.640: E/AndroidRuntime(21983): at dalvik.system.NativeStart.main(Native Method) 09-07 16:54:36.640: E/AndroidRuntime(21983): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.joegathu.criminalintent.CrimelistActivity" on path: DexPathList[[zip file "/data/app/com.joegathu.criminalintent-18.apk"],nativeLibraryDirectories=[/data/app-lib/com.joegathu.criminalintent-18, /vendor/lib, /system/lib]] 09-07 16:54:36.640: E/AndroidRuntime(21983): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67) 09-07 16:54:36.640: E/AndroidRuntime(21983): at java.lang.ClassLoader.loadClass(ClassLoader.java:497) 09-07 16:54:36.640: E/AndroidRuntime(21983): at java.lang.ClassLoader.loadClass(ClassLoader.java:457) 09-07 16:54:36.640: E/AndroidRuntime(21983): at android.app.Instrumentation.newActivity(Instrumentation.java:1079) 09-07 16:54:36.640: E/AndroidRuntime(21983): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2222) 09-07 16:54:36.640: E/AndroidRuntime(21983): ... 11 more 09-07 16:54:36.660: I/Process(21983): Sending signal. PID: 21983 SIG: 9

The above log says it didn’t find crimelistactivity class

Thing is, i honestly don’t know how to fix it. I do have the CrimeListActivity class but on a different directory. I can’t find that dexpathlist but i do have the class saved on a directory in my harddrive.

I’ve tried cleaning my project. Restarting eclipse. Checking if the libraries and depencies are ticked on the “Java build path”. I feel stuck

What’s going on? Could anyone know how to go about fixing this? I’d greatly appreciate the help


#2

Double check the spelling for the activity class name:

Looks like you have a lowercase ‘l’ - shouldn’t it be:


#3

Jesus Mary and Joseph. Thank you so much! It’s launching now without any hiccups. You must have eagle eyes my friend because i also checked my spelling but didn’t realize the difference in case. Thank you again! (I feel so stupid for missing that)