Last active
January 13, 2021 09:24
-
-
Save keyboardsurfer/a6a5bcf2b62f9aa41ae2 to your computer and use it in GitHub Desktop.
Version names for application variants
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
applicationVariants.all { variant -> | |
def flavor = variant.mergedFlavor | |
def name = flavor.getVersionName() | |
def versionName = name + '-' + variant.properties.get('flavorName') | |
if (variant.buildType.isDebuggable()) { | |
versionName += '-debug'; | |
} | |
flavor.versionName = versionName; | |
} | |
} |
Never mind, this is invalid; .all
works as expected. I had an incorrect reference to an undefined variant
elsewhere in my gradle script.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Ben! It seems this doesn't work since tools version 24.4.1.
This error suggests to me that the
.all
method has changed:Any ideas?