[英]Gradle sync failed: Could not find com.android.tools.build:gradle:3.0.1
my Android Studio project does not load this is the problem:我的 Android Studio 项目没有加载这是问题所在:
Could not find com.android.tools.build:gradle:3.0.1.
找不到 com.android.tools.build:gradle:3.0.1。 Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
在以下位置搜索: https : //jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom https://jcenter.bintray.com/com/android /tools/build/gradle/3.0.1/gradle-3.0.1.jar
And my build.gradle is:我的 build.gradle 是:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
please help, thank you请帮忙,谢谢
尝试用google()
替换jcenter()
和 build.gradle 中的 allprojects->repositories 块
Add both jcenter()
and google()
in repositories and allprojects->repositories
blocks in build.gradle
.同时添加
jcenter()
和google()
在储存库和allprojects->repositories
中的块build.gradle
。 Mine looks like this:我的看起来像这样:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
This is very similiar to ashazar's answer.这与 ashazar 的回答非常相似。 For me instead of replacing
jcenter()
with google()
, I needed both jcenter()
and google()
.对我来说,不是用
google()
替换jcenter()
,而是需要jcenter()
和google()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.