Skip to content Skip to sidebar Skip to footer

Gradle Project Sync Failed For Android Support Multidex Library

I am trying to add Multidex library to my project. I added following as dependency in my 'app/build.gradle' - complie 'com.android.support:multidex:1.0.1' when i try to sync i can

Solution 1:

add multiDexEnabled = true in your build.gradle

android {
defaultConfig {
    ...
    multiDexEnabled = true
}
}

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

add this to manifest file

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

and your Activity class

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

Solution 2:

Just make sure that you are editing the correct build.gradle file. You will get this error when editing android/build.gradle instead of android/app/build.gradle.


Post a Comment for "Gradle Project Sync Failed For Android Support Multidex Library"