I have a project with several modules in it one of which is a Android Library named (poorly) as sdk
. When I build the project it outputs an AAR named sdk.aar<
Using Gradle 6+ and AGP 4+, an alternative answer that allows full control of the name is:
afterEvaluate {
android.libraryVariants.all { variant ->
variant.variantData.outputFactory.apkDataList.each { apkData ->
if (apkData.outputFileName.endsWith('.aar')) {
apkData.outputFileName = "${project.name}-${buildType.name}-anything-you-want.aar"
}
}
}
}