简体   繁体   English

无法解决com.android.tools.build:gradle:3.0.1

[英]Could not resolve com.android.tools.build:gradle:3.0.1

Could not resolve all files for configuration ':classpath'. 无法解析配置':classpath'的所有文件。 Could not resolve com.android.tools.build:gradle:3.0.1. 无法解决com.android.tools.build:gradle:3.0.1。 Required by: project : Could not resolve com.android.tools.build:gradle:3.0.1. 要求:project:无法解析com.android.tools.build:gradle:3.0.1。 Could not get resource ' https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom '. 无法获取资源' https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom '。 Could not GET ' https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom '. 无法获取“ https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom ”。 Connect to dl.google.com:443 [dl.google.com/216.58.221.110] failed: Connection timed out: connect 连接到dl.google.com:443 [dl.google.com/216.58.221.110]失败:连接超时:连接

If you are using com.android.tools.build:gradle:3.0.1, then use only google() repository https://developer.android.com/studio/releases/gradle-plugin.html 如果您使用的是com.android.tools.build:gradle:3.0.1,则只使用google()存储库https://developer.android.com/studio/releases/gradle-plugin.html

buildscript {
    repositories {
        google()
        jcenter()
    }

It worked for me. 它对我有用。

If you're opening an existing project using Android Studio 3.0 Preview 5 or later, follow the prompts to automatically update your project to the latest version of the Android plugin. 如果您使用Android Studio 3.0 Preview 5或更高版本打开现有项目,请按照提示自动将项目更新为最新版本的Android插件。

To manually update your project, include the maven repo and change the plugin version in your project-level build.gradle file as follows : 要手动更新项目,请包含maven repo并在项目级build.gradle文件中更改插件版本,如下所示:

Apply this: 申请:

buildscript {
  repositories {
    ...
    // You need to add the following repository to download the
    // new plugin.
    google()
  }

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

From version 26.0.0 of support libraries make sure that the repositories section includes a maven section with the " https://maven.google.com " endpoint. 从版本26.0.0的支持库中,确保存储库部分包含带有“ https://maven.google.com ”端点的maven部分。

Read Document 阅读文件

allprojects {
repositories {
    jcenter()
    maven {
        url "https://maven.google.com"
    }
  }
}

For Gradle build tools plugin version 3.0.0, you can use google() repository: 对于Gradle构建工具插件版本3.0.0,您可以使用google()存储库:

Read Document 阅读文件

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

For anyone currently blocked by this, 对于目前被此阻止的任何人,

1 find the version in maven 1找到maven中的版本 森特拉尔

2 See the repository link at the bottom where it says "Note: this artifact located at .... 2请参阅底部的存储库链接,其中显示“注意:此工件位于......

in your build script repositories, create a build script repository entry using the link from maven central as below 在构建脚本存储库中,使用maven central中的链接创建构建脚本存储库条目,如下所示

   maven {
        url 'http://repo.spring.io/libs-milestone/'

    }

simple, if you got this issue you need to change add/change google() above on jcenter(). 很简单,如果你遇到这个问题,你需要在jcenter()上面更改上面的添加/更改google()。 like that: 像那样:

allprojects {
    repositories {
        //you need to change add/change google() above on jcenter()
        google()
        jcenter()
    }
}

try it, i think its help to solve your problem.. 尝试一下,我觉得它有助于解决你的问题..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法解析 com.android.tools.build:gradle:3.0.1; - Could not resolve com.android.tools.build:gradle:3.0.1 ; org.gradle.internal.resolve.ModuleVersionNotFoundException:找不到com.android.tools.build:gradle:3.0.1 - org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.tools.build:gradle:3.0.1 Android:找不到com.android.tools.build:gradle:3.0.1 - Android: Could not find com.android.tools.build:gradle:3.0.1 找不到com.android.tools.build:gradle:3.0.1 - Could not find com.android.tools.build:gradle:3.0.1 React Native FAILURE:构建失败,发生异常。 无法解析':classpath'。 找不到com.android.tools.build:gradle:3.0.1 - React Native FAILURE: Build failed with an exception. Could not resolve ':classpath'. Could not find com.android.tools.build:gradle:3.0.1 离子-无法解析com.android.tools.build:gradle:2.2.3 - ionic - Could not resolve com.android.tools.build:gradle:2.2.3 无法解决com.android.tools.build:gradle:0.5.+ - Could not resolve com.android.tools.build:gradle:0.5.+ > 无法解析 com.android.tools.build:gradle:3.5.0 - > Could not resolve com.android.tools.build:gradle:3.5.0 无法解决com.android.tools.build:gradle:2.2.3 - Could not resolve com.android.tools.build:gradle:2.2.3 无法解析 com.android.tools.build:gradle:3.3.2 - Could not resolve com.android.tools.build:gradle:3.3.2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM