Getting the error
Could not set unknown property 'outputFileName' for object of type com.android.build.gradle.internal.api.ApplicationVariantImpl.
using android studio 3.2.1
gradle 4.6
applicationVariants.all { variant ->
variant.outputs.each { output ->
def fileName = "${project.name}_${output.baseName}-${variant.versionName}.apk"
outputFileName = new File(output.outputFile.parent, fileName).getName()
}
}
you must use all
Use this code in your release biuld
android {
//...
buildTypes {
debug {
}
release {
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
def fileName = "${project.name}_${output.baseName}-${variant.versionName}.apk"
outputFileName = fileName
}
}
}
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With