找不到com.android.tools.build:gradle:3.0.0 [英] Could not find com.android.tools.build:gradle:3.0.0

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

问题描述

当我尝试从命令行构建可能的Android项目时,出现以下错误消息:


配置项目时出现问题: MYLIB。
无法解析所有配置文件':mylib:classpath'。
找不到com.android.tools.build:gradle:3.0.0。
在以下位置搜索:

https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom

https:// jcenter .bintray.com / com / android / tools / build / gradle / 3.0.0 / gradle-3.0.0.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle /3.0.0/gradle-3.0.0.pom

https://repo1.maven.org/maven2/com/android/tools/build/gradle/3.0.0/gradle-3.0.0。 jar
要求:project:mylib


当我尝试t o例如访问地址 https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom 直接通过浏览器,显示如下:

  {
errors:[{
status:404,
message:Could not找到资源
]
}

根gradle文件包含以下代码:

 依赖关系{
classpath'com.android.tools.build:gradle:3.0.0'

//注意:不要在这里放置您的应用程序依赖关系;它们属于
//在单个模块中build.gradle文件
}

...

allprojects {
储存库{
jcenter()
google()
}
}

文件gradle-wrapper.properties包含以下值:

  #Fri Oct 27 10:09:16 CEST 2017 
distributionBase = GRADLE_USER_HOME
distributionPath =包装/ dists
zipStoreBase = GRADLE_USER_HOME
zipStorePath =包装/ dists
distributionUrl = https\://services.gradle.org/distributions/ gradle-4.1-all.zip

如果我从Android Studio 3.0编译,相同的配置工作正常。
但如果我试图直接从命令行编译,我收到错误消息。

有人可以帮我吗?

解决方案

我不太确定,但也许应该尝试将存储库标记放置在依赖关系标记的同一级别。所以:

  buildscript {
知识库{
...
}
依赖关系{
...
}
}


When I try to build may Android project from command line, I get following error messages:

A problem occurred configuring project ':mylib'. Could not resolve all files for configuration ':mylib:classpath'. Could not find com.android.tools.build:gradle:3.0.0. Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar https://repo1.maven.org/maven2/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar Required by: project :mylib

And when I try to access for example the address "https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom" directly via browser, following is shown:

{
  "errors" : [ {
    "status" : 404,
    "message" : "Could not find resource"
  } ]
}

The root gradle file contains following code:

dependencies {
  classpath 'com.android.tools.build:gradle:3.0.0'

  // NOTE: Do not place your application dependencies here; they belong
  // in the individual module build.gradle files
}

...

allprojects {
  repositories {
    jcenter()
    google()
  }
}

And the file gradle-wrapper.properties contains following values:

#Fri Oct 27 10:09:16 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

The same configuration works fine if I compile from Android Studio 3.0. But if I try to compile directly from the command line, I receive the error.

Could anybody help me?

解决方案

I am not quite sure, but maybe you should try putting the repositories tag at the same level of the dependencies tag. So:

buildscript {
    repositories {
        ...
    }
    dependencies {
        ...
    }
}

这篇关于找不到com.android.tools.build:gradle:3.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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