Raghav Satyadev
1 min readJan 18, 2019

--

I am trying to change APK name and copy mapping file on same location as APK with this code

android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def date = new Date()
def formattedDate = date.format('dd_MM_yy')
output.outputFileName = "${APK_NAME}-${variant.name}-${formattedDate}.apk"
variant.assemble.doLast {
if (variant.mappingFile != null &&
variant.mappingFile.exists()) {
copy {
from variant.mappingFile
into output.outputFile.parent
}
}
}
}
}

but it shows warning:

WARNING: API ‘variant.getAssemble()’ is obsolete and has been replaced with ‘variant.getAssembleProvider()’.
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 variant.getAssemble(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Affected Modules: app

Any solution for this?

--

--