Reputation: 81
In Android Studio, I get this error when I create a project:
Could not find com.android.tools.build:gradle:4.1.2.
Upvotes: 7
Views: 10685
Reputation: 3873
Correct your app top-level build.gradle
file and include Maven repo to download plugin from:
buildscript {
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
mavenCentral()
}
}
Other option, it's possible to use beta version of Android Studio and upgrade to new version of AGP:
classpath 'com.android.tools.build:gradle:7.0.0-alpha07'
Upvotes: 11