解决WARNING: API 'variantOutput.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.
android.applicationVariants.all { variant ->
if (variant.buildType.name =="release") {
variant.outputs.all {
def fileName
def createTime =new Date().format("YYYY-MM-dd", TimeZone.getTimeZone("GMT+08:00"))
fileName ="打板_${defaultConfig.versionName}_${createTime}.apk"
def filePath ="E:/app/bondex"
File file =new File(filePath)
if (!file.exists()) {
file.mkdirs()
}
variant.getPackageApplicationProvider().get().outputDirectory =new File("$filePath")
outputFileName = fileName
}
}
}