需要 Gradle 1.8 版.当前版本是 1.9 [英] Gradle version 1.8 is required. Current version is 1.9

查看:25
本文介绍了需要 Gradle 1.8 版.当前版本是 1.9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android Studio 刚刚将自身更新到 0.4.2,现在无法解析我的项目并显示以下消息:

Android Studio just updated itself to 0.4.2, and now fails parsing my project with the message:

Gradle 版本 1.8 是必需的.当前版本是 1.9.如果使用gradle 包装器,尝试编辑 distributionUrl...

Gradle version 1.8 is required. Current version is 1.9. If using the gradle wrapper, try editing the distributionUrl...

我尝试了各种方法,现在一切都搞砸了.有点困惑这里发生了什么,人们应该认为 Android Studio 知道它已经/已经安装了哪个 Gradle(无论是什么)版本?!

I tried various things and now it's all messed up. Kind of confused what's going on here, one should think Android Studio knows which Gradle (whatever that is) version it has/had installed?!

可能是我的项目声明了对 1.8 的依赖,由于 Studio 更新将其 gradle 更新到 1.9,而没有将现有项目依赖从 1.8 更新到 1.9,因此它无法再找到?

Is it perhaps my project which declared a dependency on 1.8, which it can no longer find due to the Studio update updating its gradle to 1.9, without also updating the existing project dependency from 1.8 to 1.9?

推荐答案

Update distributionUrl 在您的 YOUR_PROJECT/gradle/gradle-wrapper.properties 文件中提到,Studio(0.4.2) 应该在 gradle 同步时自动提示自动修复,但如果它没有手动完成.distributionUrl 应该是这样的

Update distributionUrl mentioned in your YOUR_PROJECT/gradle/gradle-wrapper.properties file, Studio(0.4.2) should automatically prompt for auto fix while gradle sync but if it didn't do it manually. distributionUrl should be like

distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-all.zip

更新项目中的所有 build.gradle 文件,或者如果您使用顶级 build.gradle 文件来定义 gradle 版本更新,则仅使用

Update all build.gradle files inside your project or if you are using top level build.gradle file for defining gradle version update in that only with

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
    }
}

Android Studio(0.4.2) 仅支持 Gradle 1.9,可以在依赖类路径中使用 gradle:0.7.+ 定义.

Android Studio(0.4.2) only supports Gradle 1.9 which can be defined using gradle:0.7.+ in dependency classpath.

这篇关于需要 Gradle 1.8 版.当前版本是 1.9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆