Android customize output path and file name compile error [How to Solve]

API ‘variant.getPackageApplication()’ is obsolete and has been replaced with ‘variant.getPackageApplicationProvider()’.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getPackageApplication(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Affected Modules: app

Solution:
Modify
variant.getPackageApplication().outputDirectory
to
variant.getPackageApplicationProvider().get().outputDirectory

Similar Posts: