Android Studio下的 Error:Could not find com.android.tools.build:gradle:XXX解决方法
Android studio 更新后报错:
Gradle sync failed: Could not find com.android.tools.build:gradle:.
Searched in the following locations:
file:/D:/Android/android-studio/gradle/m2repository/com/android/tools/build/gradle//gradle-.pom
file:/D:/Android/android-studio/gradle/m2repository/com/android/tools/build/gradle//gradle-.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.3/gradle-.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.3/gradle-.jar
Required by:
project :
Consult IDE log for more details (Help | Show Log) (s ms)
解决方法:
找到你Android studio 目录
D:\Android\android-studio\gradle\m2repository\com\android\tools\build\gradle
查看gradle有什么版本:
然后在项目的build.gradle文件里修改gradle版本号:
重新build一下就好了。