Aleksey Timoshchenko Aleksey Timoshchenko - 19 days ago 5
Java Question

How to fix ClassNotFoundException?

This is something strange... I have updeted sdk version to 25 and after that tried to lunch app.. and got such error

FATAL EXCEPTION: main
Process: com.fittingroom.newtimezone, PID: 2465
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.fittingroom.newtimezone/com.fittingroom.newtimezone.view.ActivitySplash}: java.lang.ClassNotFoundException: Didn't find class "com.fittingroom.newtimezone.view.ActivitySplash" on path: DexPathList[[zip file "/data/app/com.fittingroom.newtimezone-2/base.apk"],nativeLibraryDirectories=[/data/app/com.fittingroom.newtimezone-2/lib/arm, /vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3093)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
at android.app.ActivityThread.access$1100(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.fittingroom.newtimezone.view.ActivitySplash" on path: DexPathList[[zip file "/data/app/com.fittingroom.newtimezone-2/base.apk"],nativeLibraryDirectories=[/data/app/com.fittingroom.newtimezone-2/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1095)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3083)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) 
at android.app.ActivityThread.access$1100(ActivityThread.java:221) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:158) 
at android.app.ActivityThread.main(ActivityThread.java:7224) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
Suppressed: java.lang.ClassNotFoundException: com.fittingroom.newtimezone.view.ActivitySplash
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 12 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available


I have already updated all dependency to 25 but anyway I get this error.

Error said that I don't have such class, but I have

enter image description here

What am I doing wrong? How to fix this issue?

Thanks

Answer

Well I faced the same I just used :

File -> Invalidate Caches / Restart

and it worked for me.

Comments