1

Hello I updated my android studio to 3.6.1 and suddenly i've got this error Didn't find class on path: DexPathList and after some search i've found the solution that most users suggested to enable multidex but I did'nt get the result.

this is my defaultConfig :

defaultConfig {
    applicationId "sanay.co.esn"
    minSdkVersion 21
    targetSdkVersion 29
    versionCode 2
    versionName "0.7.3"
    multiDexEnabled true
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

and this is my MultiDexApplication class :

    public class RealmConfig extends MultiDexApplication {

    private Utils utils;

    public Utils getUtils() {
        return utils;
    }

    public void setUtils(Utils utils) {
        this.utils = utils;
    }
    public static RealmConfig instance;
    public NetworkStateMonitor networkStateMonitor;
    public static boolean chat_active;
    public static String chat_active_name = "";
    public Context context;
    public static List<String> chatUsers = new ArrayList<>();



    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        instance=this;
        setUtils(new Utils(this));
        Realm.init(this);
        RealmConfiguration configuration = new RealmConfiguration.Builder().schemaVersion(7).deleteRealmIfMigrationNeeded() .build();

        Realm.setDefaultConfiguration(configuration);

        networkStateMonitor = new NetworkStateMonitor();

        Log.wtf("isMyServiceRunning",String.valueOf(getUtils().isMyServiceRunning(SignalRService.class)));


        CaocConfig.Builder.create()
                .backgroundMode(CaocConfig.BACKGROUND_MODE_SHOW_CUSTOM) //default: CaocConfig.BACKGROUND_MODE_SHOW_CUSTOM
                .enabled(true) //default: true
                .showErrorDetails(true) //default: true
                .showRestartButton(false) //default: true
                .logErrorOnRestart(true) //default: true
                .trackActivities(false) //default: false
                .minTimeBetweenCrashesMs(2000) //default: 3000
                .errorDrawable(R.drawable.logo) //default: bug image
                .restartActivity(SendLog.class) //default: null (your app's launch activity)
                .errorActivity(SendLog.class) //default: null (default error activity)
                .apply();




    }




    public static RealmConfig getInstance(){
        return instance;
    }


    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }

}
Umair
  • 5,756
  • 15
  • 39
  • 47

0 Answers0