存在类时出现ClassNotFoundException

存在类时出现ClassNotFoundException

E/AndroidRuntime: FATAL EXCEPTION: main
 Process: be.kdg.examen, PID: 4451
 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{be.kdg.examen/be.kdg.examen.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "be.kdg.examen.MainActivity" on path: DexPathList[[zip file "/data/app/be.kdg.examen-1/base.apk"],nativeLibraryDirectories=[/data/app/be.kdg.examen-1/lib/x86, /system/lib, /vendor/lib]]
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2567)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
     at android.app.ActivityThread.-wrap12(ActivityThread.java)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:154)
     at android.app.ActivityThread.main(ActivityThread.java:6119)
     at java.lang.reflect.Method.invoke(Native Method)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
  Caused by: java.lang.ClassNotFoundException: Didn't find class "be.kdg.examen.MainActivity" on path: DexPathList[[zip file "/data/app/be.kdg.examen-1/base.apk"],nativeLibraryDirectories=[/data/app/be.kdg.examen-1/lib/x86, /system/lib, /vendor/lib]]
     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
     at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
     at android.app.ActivityThread.-wrap12(ActivityThread.java) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
     at android.os.Handler.dispatchMessage(Handler.java:102) 
     at android.os.Looper.loop(Looper.java:154) 
     at android.app.ActivityThread.main(ActivityThread.java:6119) 
     at java.lang.reflect.Method.invoke(Native Method) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

我在尝试运行应用程序时总是遇到此错误。有一个主要的活动,所以我真的不知道问题是什么。
android - Android:存在类时出现ClassNotFoundException-LMLPHP

最佳答案

这似乎是多索引支持的问题。请看下面的线
FATAL EXCEPTION: main java.lang.NoClassDefFoundError: rx.plugins.RxJavaHooks

关于android - Android:存在类时出现ClassNotFoundException,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45672340/

10-11 01:16