I'm currently working on creating my own Gradle custom distribution and I want to add some default settings to all my Android projects. I tried to do this with the following init script:
initscript {
    repositories {
      mavenCentral()
      google()
    }
    
    dependencies {
      classpath "com.android.tools.build:gradle:7.1.1"
    }
}
apply plugin: 'com.android.application'
gradle.allprojects {
    android {
        ...
    }
    dependencies {
        implementation 'junit:junit:4.12'
    }
}
but with this I get Plugin with id 'com.android.application' not found. What am I missing here?
 
     
     
    