flamy
01/23/2024, 6:02 PM// Project-level build.gradle
plugins {
id("com.android.application") version "8.2.0" apply false
id("com.android.library") version "8.2.0" apply false
}
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.4.1")
}
}
Hello guys, by reading official doc, it's very clear to me that com.android.application
is the AGP (Android Gradle Plugin).
However I don't understand the difference with com.android.tools.build:gradle
. Actually this one sounds more like AGP to me.
There are some SO answers that say that com.android.tools.build:gradle
is the AGP, so I'm not sure which one is AGP anymore.
Thank you in advance guys 🙂flamy
01/23/2024, 6:04 PM.kts
😄p-schneider
01/23/2024, 7:15 PMp-schneider
01/23/2024, 7:20 PMplugins { id("...") }
is the "new" and preferred way of loading gradle plugins.
Using buildscript { ... }
is the "old" and deprecated way of loading gradle plugins.
The different Approaches can be seen in the gradle docs https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_blockflamy
01/23/2024, 7:20 PMcom.android.tools.build:gradle
anymorep-schneider
01/23/2024, 7:22 PMcom.android.tools.build:gradle:8.2.2
etc. but automatically in the background. So you normally woudn't declare that directly but load it via the plugins block instead.
That is just the path of the artifact that will be downloaded by gradle from the google maven and where both the com.android.application and com.android.library plugin are then loaded from.Daniel B Duval
01/24/2024, 2:00 PM