Gradle Dsl Method Not Found: 'Runproguard'

After Android Studio update: Gradle DSL method not found: 'runProguard()'

runProguard has been renamed minifyEnabled. See the changelog here for confirmation - version 0.14.0 (2014/10/31) of the Android Gradle plugin made the swap.

Screenshot showing change location in IDE

ERROR: Gradle DSL method not found: 'implementiation()' Possible causes:

It's a typo in your build.gradle. You have used implementiation instead of implementation.

Change this like below:

implementation 'com.google.firebase:firebase-perf:19.0.4'

instead of

implementiation 'com.google.firebase:firebase-perf:19.0.4'

Error:(26, 0) Gradle DSL method not found: 'runProguard()'

As far as I know runProguard was replaced with minifyEnabled. I am still not sure how to define the config for proguard but a Google search should help you to find out.

Edit:

For the outFile read here: https://groups.google.com/forum/#!topic/adt-dev/4_-5NvxuFB0 how they do it.

In short: they used a more complex version:

applicationVariants.all { variant ->

variant.outputs.each { output ->

def apk = output.outputFile;
def newName;

// newName = apk.name.replace(".apk", "-v" + defaultConfig.versionName + "-" + variant.buildType.name.toUpperCase() + ".apk");
if (variant.buildType.name == "release") {
newName = apk.name.replace(".apk", "-v" + defaultConfig.versionName + "-release.apk");
} else {
newName = apk.name.replace(".apk", "-v" + defaultConfig.versionName + "-beta.apk");
}

output.outputFile = new File(apk.parentFile, newName);

if (output.zipAlign) {
output.outputFile = new File(apk.parentFile, newName.replace("-unaligned", ""));
}

logger.info('INFO: Set outputFile to ' + output.outputFile + " for [" + output.name + "]");
}
}


Related Topics



Leave a reply



Submit