Skip to content Skip to sidebar Skip to footer

Java.lang.classnotfoundexception In Asynctask On Api 16 To 19

I have an error that only happens in android 4 (API 16 to 19). I use the following code private class AcceptBooking extends AsyncTask { int respon

Solution 1:

Add this line in build.gradle:

compile 'com.android.support:multidex:1.0.1'

Now, inside the application tag in your mainfest add this line,

android:name="android.support.multidex.MultiDexApplication"

Then create the following class:

publicclassMultiDexApplicationextendsApplication { 
publicMultiDexApplication() { } 
    protectedvoidattachBaseContext(Context base) {   super.attachBaseContext(base); 
MultiDex.install(this);
} 
    } 

Post a Comment for "Java.lang.classnotfoundexception In Asynctask On Api 16 To 19"