After upgrading 'Android Gradle plugin' to 3.4.0, I have got a warning message in /app/build.gradle
WARNING: API 'variantOutput.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'. It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getPackageApplication(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
I have tried 'android.debug.obsoleteApi=true' in 'gradle.properties' as recommended, then I got this message.
REASON: Called from: [android project path]/app/build.gradle:31
The code containing line 31 is the code below.
android { buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release applicationVariants.all { variant -> variant.outputs.each { output -> project.ext { appName = 'my_app' } def newName = output.outputFile.name newName = newName.replace("app-", "$project.ext.appName-") newName = newName.replace("-release", "-" + defaultConfig.versionName) def relativeRootDir = output.packageApplication.outputDirectory.toPath().relativize(rootDir.toPath()).toFile() output.outputFileName = new File("$relativeRootDir/", newName) } } } } } The line 31 is
def newName = output.outputFile.name Is this part using API 'variantOutput.getPackageApplication()'? What should I do to solve this warning?