为什么我会收到"找不到com.android.tools.build:gradle"错误? [英] Why am I getting "could not find com.android.tools.build:gradle" error?

查看:572
本文介绍了为什么我会收到"找不到com.android.tools.build:gradle"错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是基于了我最后的<一个href=\"http://stackoverflow.com/questions/30958596/how-to-resolve-low-sdk-build-tools-error\">question为好。

This is based off my last question as well.

在此之后教程,我克隆项目到我的机器,并想获得该项目才能正确地构建。

Following this tutorial, I cloned the project into my machine and am trying to get the project to build properly.

在固定我在最后一个问题得到了错误的过程中,我遇到了一个新的错误。

这是构建脚本的部分,我试图修复/编辑

In the process of fixing the error I got in my last question, I encountered a new error.
This is the section of the build script I am trying to fix/edit

buildscript {
     repositories {
         mavenCentral()
         mavenLocal()
         maven { url 'https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/' }
      }
      dependencies {
            classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.3'
            classpath 'com.android.tools.build:gradle:1.2.3'
      }
 }

说明如何检查摇篮版本,我检查煤矿,看到我是跑摇篮版本2.2.1。根据关,我改变了

Following the instructions on how to check Gradle version, I checked mine and saw that I was running Gradle version 2.2.1. Based off that, I changed

    classpath 'com.android.tools.build:gradle:1.2.3'

   classpath 'com.android.tools.build:gradle:2.2.1'

但改变这种构建脚本code,并试图重建我的项目后,我得到了上述的错误(下完整的堆栈跟踪)

However after changing that build script code, and attempting to rebuild my project, I get the above mentioned error(full stack trace below)

    Error:Could not find com.android.tools.build:gradle:2.2.1.
Searched in the following locations:
    file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.pom
    file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.jar
    https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.pom
    https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.jar
    file:/C:/Users/chris/.m2/repository/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.pom
    file:/C:/Users/chris/.m2/repository/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.jar
    https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.pom
    https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.jar
Required by:
    :theplanethatcouldntflygood:unspecified

有谁知道为什么我收到此错误或如何解决这一问题?它没有任何意义,我来点在摇篮版本的Java编译器(类路径),我不即使使用。

Does anyone know why I am getting this error or how to fix this? It doesn't make sense for me to point the Java compiler(classpath) at a Gradle Version that I am not even using.

推荐答案

您的Andr​​oid插件的gradle的gradle和版本之间的混淆。

You are confusing between android gradle plugin and gradle version.

类路径com.android.tools.build:gradle:1.2.3是Android的Gradle一个插件,并作为这一次,1.2.3是最新的。

This classpath 'com.android.tools.build:gradle:1.2.3' is a gradle plugin for Android and as of this time, 1.2.3 is the latest.

该版本的Gradle本身就是gradle-wrapper.properties文件。 2.4是最新的版本,

The gradle version itself is in gradle-wrapper.properties file. 2.4 is the latest version,

这篇关于为什么我会收到&QUOT;找不到com.android.tools.build:gradle&quot;错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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