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
Build Type should override the Product Flavor. Try next one.
Build Type
Product Flavor
buildTypes { release { versionName = android.defaultConfig.versionName } }