Android Gradle suggest change

Delete unaligned apk automatically

If you don’t need automatically generated apk files with unaligned suffix (which you probably don’t), you may add the following code to build.gradle file:

// delete unaligned files
android.applicationVariants.all { variant ->
  variant.assemble.doLast {
    variant.outputs.each { output ->
        println "aligned " + output.outputFile
        println "unaligned " + output.packageApplication.outputFile

        File unaligned = output.packageApplication.outputFile;
        File aligned = output.outputFile
        if (!unaligned.getName().equalsIgnoreCase(aligned.getName())) {
            println "deleting " + unaligned.getName()

From here

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents