In my Android project, there are several product flavors:
buildTypes {
release {}
debug {}
staging {}
}
productFlavors {
freeVersion {}
Another solution is to disable the task the google-services plugin adds - here I enable the task if the flavorName is not "freeVersion" but this logic can clearly be updated to say look at the variants buildType instead.
apply plugin: 'com.google.gms.google-services'
// must be after the plugin is applied otherwise no tasks will be found
android.applicationVariants.all { variant ->
def googleTask = tasks.findByName("process${variant.name.capitalize()}GoogleServices")
googleTask.enabled = !"freeVersion".equals(variant.flavorName)
}