Gradle : DSL element 'useProguard' is obsolete and will be removed soon

Denis picture Denis · Aug 24, 2019 · Viewed 17.1k times · Source

Since the 3.5 update of Android Studio, I have this warning when building my app :

DSL element 'useProguard' is obsolete and will be removed soon. Use 'android.enableR8' in gradle.properties to switch between R8 and Proguard..

Answer

Denis picture Denis · Aug 24, 2019

Enabling R8 into the gradle.properties file:

android.enableR8=true

And removing "useProguard" into build.gradle:

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

fixed the problem.