buildConfigField depending on flavor + buildType
问题 I'm trying to define a buildConfigVariable depending on the flavor + buildType . Ideally, this is what I want productFlavors { strawberry { buildConfigField "String", "WS_API_KEY", name + variant.buildType.name } ... more flavors .. } name does contain "strawberry", but I don't know if it's possible to access the variant 's buildType . Placed outside the Android closure I do have access to the BuildType and variant , but then I can't invoke buildConfigField android.applicationVariants.all {