I want to make aab file name by build type. But it is not made.
compileSdkVersion 30
buildToolsVersion "30.0.2"
targetSdkVersion 30
buildTypes {
def project = "myapplication"
def separator = "_"
def date = new Date();
def formattedDate = date.format('yyyyMMdd_HHmm')
release {
setProperty("archivesBaseName", "${project}${separator}release${separator}${formattedDate}")
}
debug {
setProperty("archivesBaseName", "${project}${separator}debug${separator}${formattedDate}")
}
or
def buildType
applicationVariants.all { variant ->
variant.outputs.each { output ->
buildType = variant.buildType.name
}
}
setProperty("archivesBaseName", "${project}${separator}${buildType} ${separator}${formattedDate}")
build type = null
What is the problem?