This configuration is in the early AS2.0 version:
Settings in app---->build.gradle
Applicationvariants.all {Variant -i = output.outputfile if null && outputFile.name.endsWith ('. apk ')) { = "driver_${variant.productflavors[ 0].name}_v${defaultconfig.versionname}.apk " new File (outputfile.parent, FileName ) } } }
After 3.0 with the following configuration:
buildtypes { debug{ //Modify debug State Buildconfigfield "boolean", "Is_debug", "true" Android.applicationVariants.all {variant- Variant.outputs.all { outputfilename = "${appname}_${ variant.versionname}_debug.apk " } } } release { //Modify debug State Buildconfigfield" Boolean " , "Is_debug", "true" minifyenabled false proguardfiles getdefaultproguardfile (' Proguard-android-optimize.txt '), ' Proguard-rules.pro ' android.applicationVariants.all {variant - Variant.outputs.all { outputfilename = "${appname}_${variant.versionname}_release.apk"}} } }
The Debug field also customizes the Project field
Android package generates the APK when the custom file name version number. Customizing Project fields and more