java.lang.ClassNotFoundException: Didn't find class on path: DexPathList , After updating sdk

后端 未结 5 1586
情话喂你
情话喂你 2021-01-18 03:08

Hello guys My application was all working fine till yesterday, i updated my SDK yesterday and it started giving error first it gave an error

No resou

相关标签:
5条回答
  • 2021-01-18 03:08

    Same error happened to me because I installed the debug apk that created inside outputs\apk folder and it turns to be smaller and with missing classes because it probably was the outcome of an instant run. So instead of turning instant run off just build APK (by Build->build apk in the menu) and use this one.

    0 讨论(0)
  • 2021-01-18 03:10

    Write a class EnableMultiDex like below

    public class EnableMultiDex extends MultiDexApplication {
        private static EnableMultiDex enableMultiDex;
        public static Context context;
    
        public EnableMultiDex(){
            enableMultiDex=this;
        }
    
        public static EnableMultiDex getEnableMultiDexApp() {
            return enableMultiDex;
        }
    
        @Override
        public void onCreate() {
            super.onCreate();
            context = getApplicationContext();
    
        }
    }
    

    and in AndroidManifest.xml write this class inside Application tag

     <application
        android:name="YourPakageName.EnableMultiDex"
        android:hardwareAccelerated="true"
        android:icon="@drawable/launch_logo"
        android:label="@string/app_name"
        android:largeHeap="true"
        tools:node="replace">
    
    0 讨论(0)
  • 2021-01-18 03:18

    In my case my project began to work again after:

    • Uninstall my project from the emulator (or real device)
    • Clean Project
    • Make Project
    0 讨论(0)
  • 2021-01-18 03:22

    Yes may be above answer is correct I did not try as it is. But I resolved in opposite way is "You remove the instant run option in the settings of android studio"

    Go to --> file menu --> select settings --> select build,execution,deployment-->select instant run --> un check the "enable instant run".

    It was worked for me. but some applications like google maps integrated apps required Instant run.

    0 讨论(0)
  • 2021-01-18 03:24

    Disable instant run worked for me I think this issue occurs because some class is missing when build with install run ( reduce apk size)

    0 讨论(0)
提交回复
热议问题