How to set name of AAR output from Gradle

后端 未结 7 442
一整个雨季
一整个雨季 2021-01-30 10:18

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<

7条回答
  •  一生所求
    2021-01-30 10:58

    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"
            }
        }
    }
    

提交回复
热议问题