I'd like to append special suffixes to my output APK files based on the current buildType. I am trying to use the standard Gradle's versionNameSuffix command:
android {
defaultConfig {
...
versionNameSuffix "-XXX"
}
buildTypes {
debug {
versionNameSuffix "-YYY"
}
release {
versionNameSuffix "-ZZZ"
}
}
}
For some reason none of these suffixes gets applied to the actual output file name. Does Android Studio ignore this command? Whatever I do the result is the same: <module_name>-debug.apk or <module_name>-release.apk.
Here's my config:
classpath 'com.android.tools.build:gradle:2.2.3'
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
Does Android Studio ignore this command?
No, but versionNameSuffix does not affect the filename. It affects the versionName (BuildConfig.VERSION_NAME, the version name shown in Settings, etc.).
You can teach Gradle to embed versionName in the APK filename, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With