I need to transfer the code version number from build.gradle in the filename .apk. For example, app-release_v3.apk.
Please help to find a solution. Thank you!
I need to transfer the code version number from build.gradle in the filename .apk. For example, app-release_v3.apk.
Please help to find a solution. Thank you!
In build.gradle of the app module
android {
...
defaultConfig {
...
archivesBaseName = "MyAppName_v${versionName}"
}
}
As result you will have MyAppName_v3-release.apk
You can use the "archivesBaseName"
properties in your build.gradle
file.
Somenthing like:
defaultConfig {
project.ext.set("archivesBaseName", "app-xxx." + defaultConfig.versionName);
}