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<
sdk
sdk.aar<
In my case, ${version} result in "unspecified", finnally I found ${defaultConfig.versionName} works.
android { ... libraryVariants.all { variant -> variant.outputs.all { outputFileName = "${variant.name}-${defaultConfig.versionName}.aar" } } }