At the project level, the Gradle file of an android project contains google() and mavenCentral() inside the repository block.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.0"
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have read a related answer Difference between google() and maven { url 'https://maven.google.com' }, but it doesn't describe about mavenCentral(). That answer is based on google() as a replacement of maven { url 'https://maven.google.com' }. But in my case google() and mavenCentral() both are used alongside.