Android Studio-Gradle-diagnostics-X.X.X.jar上的Gradle同步错误 [英] Android Studio - Gradle sync error on gradle-diagnostics-X.X.X.jar

查看:235
本文介绍了Android Studio-Gradle-diagnostics-X.X.X.jar上的Gradle同步错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚更新了Android Studio,无法再同步项目了.

I've just updated Android Studio and I can't sync my project anymore.

事件日志报告:

Gradle sync failed: /Applications/Android Studio.app/Contents/gradle/gradle-X.X.X/lib/plugins/gradle-diagnostics-X.X.X.jar (No such file or directory)

推荐答案

要解决Gradle同步错误,请打开 gradle-wrapper.properties 文件,然后从以下位置更新Gradle包装器分发版本:

To solve the Gradle sync error, open gradle-wrapper.properties file and update the Gradle wrapper distribution version from:

distributionUrl=https\://services.gradle.org/distributions/gradle-X.X.X-all.zip

收件人:

  • Android Studio 3.4 distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
  • Android Studio 2.3 distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip
  • Android Studio 2.2 distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
  • Android Studio 2.1 distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
  • Android Studio 2.0 distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
  • Android Studio 1.5 distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
  • Android Studio 1.3 distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
  • Android Studio 3.4 distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
  • Android Studio 2.3 distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip
  • Android Studio 2.2 distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
  • Android Studio 2.1 distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
  • Android Studio 2.0 distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
  • Android Studio 1.5 distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
  • Android Studio 1.3 distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip


您可以在以下位置找到最新的Gradle包装器版本: https://services.gradle.org/distributions/


You can find the latest Gradle wrapper version visiting: https://services.gradle.org/distributions/

编辑:
附带说明一下,正如@SeBsZ所建议的那样, Android Gradle插件的官方存储库已从MavenCentral切换到jCenter(

EDIT:
As a side note, as @SeBsZ suggests, the official repository of the Android Gradle plugin switched from MavenCentral to jCenter (see Bintray blog post).

确保您的项目 build.gradle 文件包含新的存储库和新的类路径:

Make sure your project build.gradle file contains the new repository and the new classpath:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

这与问题不是严格相关的,但是由于我们已经在迁移到新的IDE预览,所以最好确保所有内容都到位.

This is not strictly related to the question problem, but since we are already migrating to the new IDE preview it's better to make sure everything is in place.

这篇关于Android Studio-Gradle-diagnostics-X.X.X.jar上的Gradle同步错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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