This exception is reported 10/week, I tried to find solution but failed. I'm a little frustrated with this sort of exception, and searched all related posts. (P.S. I noticed that full name (android:name="com.example.AcraApplication") throw more exceptions than short one(android:name=".AcraApplication").)
public class AcraApplication extends Application {
public void onCreate() {
ACRA.init(this);
super.onCreate();
}
<application
android:name=".AcraApplication"
android:icon="@drawable/app_icon"
android:label="@string/app_name" >
LogCat:
java.lang.RuntimeException: Unable to instantiate application com.example.AcraApplication: java.lang.ClassNotFoundException: Didn't find class "com.example.AcraApplication" on path: DexPathList[[zip file "/mnt/asec/com.example-2/pkg.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4554)
at android.app.ActivityThread.access$1600(ActivityThread.java:161)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1325)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5356)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.AcraApplication" on path: DexPathList[[zip file "/mnt/asec/com.example-2/pkg.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newApplication(Instrumentation.java:993)
at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
... 11 more
Suppressed: java.io.IOException: unable to open DEX file
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:296)
at dalvik.system.DexFile.<init>(DexFile.java:80)
at dalvik.system.DexFile.<init>(DexFile.java:59)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:263)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:230)
at dalvik.system.DexPathList.<init>(DexPathList.java:112)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:58)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:65)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:57)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:326)
at android.app.LoadedApk.makeApplication(LoadedApk.java:508)
... 11 more
EDIT: I noticed that when I reinstall&open using ctrl+F11 in eclipse without clicking its icon, it occurs more frequently.
java.io.IOException: unable to open DEX file
, this is before any of your classes are loaded, so it doesn't have anything to do with how you define your application class in the Manifest. – Scharff