android - 尽管升级了包装器,但运行 gradle 命令时出错

标签 android gradle

我已经将此设置为我的 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/

相关文章:

android - 菜单项#getTag()

android - Activity 和 Fragment 中可以实现的 DialogFragment 接口(interface)

android - 项目没有 project.properties 文件!编辑项目属性以设置一个

android - Gradle:多维 flavor ApplicationId

java - 为什么我的应用程序VSCode不能在CLI中正确运行?它是一个 Spring 启动应用程序

android - 在 build.gradle 上添加存储库的位置和原因

android - 如何在android中解析HTML响应

android - 设置 Activity 的标题栏名称

grails - Groovy 环境管理器如何处理 Windows 环境变量

android - 在Android Studio中安装Roboguice