I want to change version name for app flavors but only if it\'s a debug build.
(e.g. debug builds will have versions like 1.0.1 D (DEBUG) 555 or 1.0.1 P (DEBUG) 555
After hours of searching I've managed to remove all the changes made to the version name for the release build using this code
applicationVariants.all { variant -> if (variant.buildType.name == 'release') { variant.mergedFlavor.versionName = android.defaultConfig.versionName; } }