Solve Could not find com. android. tools. build: gradle: 3.0. 0
- 2021-12-13 16:52:09
- OfStack
android studio Upgrade 3.0, gradle Upgrade 4.1 after the project error, as follows
Could not resolve all files for configuration ': classpath'.
Could not find com.android.tools.build:gradle:3.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
Required by:
project :* Try:
Run with-stacktrace option to get the stack trace. Run with-debug option to get log output.
Solution: In builde. gradle of project, do the following and add google ()
buildscript {
repositories {
google()
....
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
.....
}
}