Android自定义输出路径与文件名编译报错

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

解决办法:

variant.getPackageApplication().outputDirectory
改为
variant.getPackageApplicationProvider().get().outputDirectory

posted @ 2022-01-10 14:45  北海南竹  阅读(356)  评论(0)    收藏  举报