When you are creating new Android project with the latest version of Android Studio it will now give you a project level build.gradle that only contains plugins block
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.0' apply false
id 'com.android.library' version '7.1.0' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}
My question is how to specify now the version of AGP with this setup? Before it looks like this
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
// This block encapsulates custom properties and makes them available to all modules in the project.
ext {
kotlin_version = '1.6.20-M1'
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.0-alpha03'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
I also wonder how would you add classpath on some plugins that still requires it like
classpath 'com.google.gms:google-services:4.3.10'
What I also do not understand is what does com.android.library plugin do and why is it in app module?
Another thing to ask is with this new setup you have two plugins block, one in app level and one in project level. Is this really necessary? What is the point of that? Thanks