java.lang.ClassNotFoundException on working app java.lang.ClassNotFoundException on working app android android

java.lang.ClassNotFoundException on working app


Yep, I had this exact same problem. It was because I specified the android:name attribute in the application node in the manifest file.

Your Android Manifest file probably looks something like this:

   <application        android:name="Novak ESC Track guide"        android:icon="@drawable/icon"        android:label="@string/app_name"        android:description="@string/help_text" >

Do not use the android:name attribute! unless you've implemented a custom Application object.

The application:name attribute has nothing to do with the name of your app. This is the name of a specific class to load as your Application instance. That's why you would get the ClassNotFoundException if that class wouldn't exist.

For the name of the app use the android:label attribute on this same application node instead.

Remove it and it should work:

<application     android:icon="@drawable/icon"     android:label="@string/app_name"     android:description="@string/help_text" >


Something like this happened when I changed the build target to 3.2. After digging around I found that a had named the jar lib folder "lib" instead of "libs". I just renamed it to libs and updated the references on the Java build path and everything was working again. Maybe this will help someone...


We have a couple of projects where this issue was logged from time to time on the Android Market. I found the following issues in the manifests:

  1. If the package name is com.test then activities names should be .ActivityName (with a leading dot), not just ActivityName.

  2. For some classes, those that appeared in the logs most often, the class name was specified as com.test.Name while it should have been .Name.

I guess many implementations of Android handle these minor issues successfully (this is why the exception never happened in testing), while others few are throwing the exception.