Rename output file in the new Android Plugin 3.0.0-alpha1

Viewed 5811

I was using this in the previous gradle plugin and it was working fine.

applicationVariants.all { v ->
v.outputs.each { output ->
    output.outputFile = new File(
            output.outputFile.parent,
            output.outputFile.name.replace("app-release.apk", "companyName-app-v${variant.versionName}.apk"))
}}

With the recent update to 3.0.0-alpha1 it shows error.

I read the link https://developer.android.com/studio/preview/features/new-android-plugin-migration.html but was unable to find the exact source of error.

Is there a fix to this I am missing?

3 Answers
Related