Search code examples
androidgroovyandroid-gradle-pluginapk

Getting error after upgrading Android Gradle Plugin to 8.2.0: Gradle DSL method not found: 'archivesBaseName()'


After I updated Android Gradle Plugin from version 8.1.4 to 8.2.0 I am getting this error:

Gradle DSL method not found: 'archivesBaseName()'

I use this method for specifying the output apk filename, like this:

archivesBaseName "${rootProject.name.replaceAll(" ", "")}-v${versionName}"

Since it seems like this function is removed from AGP now, what are the alternatives?


Solution

  • I was able to solve this issue by changing it to this:

    setProperty("archivesBaseName", "${rootProject.name.replaceAll(" ", "")}-v${versionName}")