7

After adding useProguard true and multidexEnabled true to my built types this error comes up when trying to build:

Error:Build-in class shrinker and multidex are not supported yet.

compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
    applicationId "com.example.android
    minSdkVersion 16
    targetSdkVersion 23
    versionCode gitVersionCode()
    versionName gitVersionName()
    multiDexEnabled true
}

buildTypes {
    debug {
        ...
        useProguard false
        debuggable true
    }
    release {
        ...
        useProguard true
    }

Running Android Studio 2.0 Beta 5.

Any solution besides removing multidex?

2
  • I am having the same problem. replacing useProguard with minifyEnabled and building multiple times made by app build successfully again.. Feb 26, 2016 at 7:10
  • I had the same error message on AS2.2. In my case, removing all "useProguard" and replacing it with "minifyEnabled" fixed the issue. According to the google.github.io/android-gradle-dsl/current/…, "useProguard" no longer exists.
    – Manabu-GT
    Feb 9, 2017 at 22:57

4 Answers 4

12

useProguard became minifyEnabled. Try the following:

android {
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
        }
    }
}
0
1

Just in case someone is still looking into this. First of all, try to avoid the 64k limit (and avoid using multiDexEnabled) by enable code shrinking. Try the following:

android {
    ...
    buildTypes {
        release {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                'proguard-rules.pro'
        }
    }
}

If the above doesn't work and you have to use miltiDexEnabled then don't use proguard and don't try to shrink resources. Try the following:

buildTypes {
    ...
    release {
        minifyEnabled false
        ...
    }
}
0

Simply disable shrinkResources, and multiDexEnable, it solved the problem.

shrinkResources false
multiDexEnabled false

Also, disable dex option false if you have dexoption as below:

dexOptions {
        incremental false
    }
-2

just remove multidexEnabled and use progaurd from there and give it a try.

2
  • I want to have multidex enabled due to the 64K limit.
    – powder366
    May 7, 2016 at 14:10
  • @powder366 if you use proguard, you won't need to enable multidex for 64k limit ;) Sep 12, 2017 at 15:31

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.