6

I have entered below code in my Gradle.

///start
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            println("Roop: mappingFile:  ${output.outputFile}")
        }
            variant.assemble.doLast {
//            doLast {
                File dir = new File("${project.projectDir}/out1")
                dir.mkdirs()
                println("Roop: copy")
                variant.outputs.each { output ->
                    File file = output.outputFile
                    println("Roop: file:" + file)
                }
            }
    }

Now when i perform Build Apk from android studio, Variant.assemble.doLast gets executed after apk is created. But the same doLast is not called if i perform Build Bundle.

Any info why doLast does not get called for BuildBundle ?

Gabriele Mariotti
  • 250,295
  • 77
  • 670
  • 690
user1340801
  • 413
  • 3
  • 10
  • 21
  • Possible duplicate of [How to change the generated filename for App Bundles with Gradle?](https://stackoverflow.com/questions/52508720/how-to-change-the-generated-filename-for-app-bundles-with-gradle/52521936) – Martin Zeitler Aug 26 '19 at 08:34
  • @Gabriele did you get the solution? If yes then please share it with me – Akshay Busa Aug 25 '21 at 04:15

0 Answers0