java.lang.RuntimeException:无法实例化活动(无法打开DEX文件)

时间:2014-11-16 13:03:35

标签: java android crash google-play crash-reports

我最近在谷歌播放中发布了一个Android应用程序,到目前为止一切看起来很棒, 但是有一个例外(见下文),我有时会在控制台中收到崩溃,它只发生在一些用户身上!! 我根本无法重现它。

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.bendev.ronda.game.activity/com.bendev.ronda.game.activity.RondaOptionsActivity}: java.lang.ClassNotFoundException: Didn't find class "com.bendev.ronda.game.activity.RondaOptionsActivity" on path: DexPathList[[zip file "/mnt/asec/com.bendev.ronda.game.activity-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/com.bendev.ronda.game.activity-1/lib, /vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2297)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2452)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1302)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5586)
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:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.bendev.ronda.game.activity.RondaOptionsActivity" on path: DexPathList[[zip file "/mnt/asec/com.bendev.ronda.game.activity-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/com.bendev.ronda.game.activity-1/lib, /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.newActivity(Instrumentation.java:1067)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2288)
... 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)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4684)
at android.app.ActivityThread.access$1600(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1362)
... 8 more

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

检查您的build.gradleAndroidManifest.xmlRondaOptionsActivity.java中的包名是否匹配。

看起来应该是:

com.bendev.ronda.game.activity