gpt4 book ai didi

java.lang.RuntimeException : Unable to instantiate activity (unable to open DEX file)

转载 作者:行者123 更新时间:2023-12-02 13:04:46 32 4
gpt4 key购买 nike

我最近在 Google Play 中发布了一个 Android 应用程序,到目前为止一切看起来都很棒,但有一个异常(exception)(见下文),我有时会收到控制台崩溃的消息,它只发生在某些用户身上!
我根本无法重现它。

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

感谢您的帮助。

最佳答案

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

看起来应该是:

com.bendev.ronda.game.activity

关于java.lang.RuntimeException : Unable to instantiate activity (unable to open DEX file),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26957212/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com