Gradle同步失败:支持的最低Gradle版本为4.1-rc-1。当前版本是3.3。如果使用gradle包装器,请尝试将C:\ Users \ hp \ Downloads \ try \ gradle \ wrapper \ gradle-wrapper.properties中的distributionUrl编辑为gradle-4.1-rc-1-all.zip
注意-我使用3.3版本的本地gradle分发,因为使用默认gradle会显示此错误:Gradle同步失败:原因:打开zip文件时出错。文件可能损坏了。
Gradle wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=\
https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
项目的Build.gradle
buildscript {
repositories {
maven {
url 'https://maven.google.com'
}
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta1'
// 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
}