Different Gradle plugin version for different flavors(Android Studio)

I currently have this configuration in gradle.build:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.amazon.device.tools.build:gradle:0.12.+'
    }
}

What I would like to do is to have different Gradle plugin versions for different flavors, something like:

dependencies {
        normal {
            classpath 'com.android.tools.build:gradle:0.12.+'
        }
        amazon {
            classpath 'com.amazon.device.tools.build:gradle:0.12.+'
        }
}

Is something like this possible?

This is not possible at the moment. could you elaborate a bit more about your usecase

From my understanding, for the amazon Gradle plugin to work, the Amazon Add-on needs to be installed, so it can bring errors at build time. Does ‘compileSdkVersion’ also have this limitation?

As far as I understand the amazon gradle plugin is a tweaked version of the original android gradle plugin. It would be better if amazon add a plugin on top of that android plugin. With the current situtation you need to invoke your build twice to build your apps with the amazon dev kit and the original android plugin. you could use project or system properties to make this switch convenient.

Thanks for the information. So ‘compileSdkVersion’ has to be the same for all flavors too?