0

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

Chirag Parmar
  • 833
  • 11
  • 26
Sirop4ik
  • 4,543
  • 2
  • 54
  • 121

4 Answers4

4

Well I faced the same I just used :

File -> Invalidate Caches / Restart

and it worked for me.

M.Khouli
  • 3,992
  • 1
  • 23
  • 26
0

I faced this error before: First try this to clean and rebuild your project.

Then open File --> Invalidate Caches / Restart , Click on the blue button Invalidate Caches / Restart.

If this didn't work with u try this solution:

1- add to your build.gradle(Module.app)

 defaultConfig {
         multiDexEnabled true

2- add this in dependencies:

dependencies {
    compile 'com.android.support:multidex:1.0.1'
}

2- In manifest file add this

<application
android:name="android.support.multidex.MultiDexApplication">

It works with me Correctly.

And I think the Problem is that you are using a lot of Libraries in the Gradle ,You might have exceeded the 64K Reference Limit.

Malik Abu Qaoud
  • 208
  • 1
  • 9
0

we can get this issues different way,

1.If you use instant run please unchecked its options

2.Add multiDexEnabled true to gradle or add multidex in your project application class

Vadivel
  • 780
  • 1
  • 6
  • 21
0

I have the same error and fix it. Because when I created I changed the default MainActivity name but I did not change in the manifest default folder.

<application>
    <activity android:name=".MakeSureYouHaveTheSame'MainActivity'NameHere">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
Dmitriy
  • 5,525
  • 12
  • 25
  • 38
T.Ahmed
  • 11
  • 3