我已经将此设置为我的 gradle.propertiesdistributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
当我输入命令 gradle
它总是显示错误Minimum supported Gradle version is 2.14.1. Current version is 2.11. If using the gradle wrapper, try editing the distributionUrl
我错过了什么?
这是我的 build.gradle (项目)
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.1'
defaultConfig {
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
gradle.build(模块)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
// 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
}
先感谢您。
最佳答案
“当我输入命令 gradle
”表示您正在从命令行开始构建。在这种情况下使用 gradlew
从项目根目录中,否则将不会使用包装器。命令gradle
启动永久安装在盒子上的 gradle 版本。
试试 gradle --version
和 ./gradlew --version
确认。
关于android - 尽管升级了包装器,但运行 gradle 命令时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39091659/