欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

Could not resolve all artifacts for configuration ‘:classpath‘.

程序员文章站 2022-03-13 21:34:21
> Could not resolve all artifacts for configuration ':classpath'. > Could no18:40 Gradle sync failed: Could not find trove4j.jar (org.jetbrains.trove4j:trove4j:20160824). Searched in the following locations: https://j......

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find asm-analysis.jar (org.ow2.asm:asm-analysis:7.0).
     Searched in the following locations:
         https://jcenter.bintray.com/org/ow2/asm/asm-analysis/7.0/asm-analysis-7.0.jar
   > Could not find httpclient.jar (org.apache.httpcomponents:httpclient:4.5.6).
     Searched in the following locations:
         https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.5.6/httpclient-4.5.6.jar
   > Could not find commons-io.jar (commons-io:commons-io:2.4).
     Searched in the following locations:
         https://jcenter.bintray.com/commons-io/commons-io/2.4/commons-io-2.4.jar
   > Could not find gson.jar (com.google.code.gson:gson:2.8.5).
     Searched in the following locations:
         https://jcenter.bintray.com/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar
   > Could not find auto-value-annotations.jar (com.google.auto.value:auto-value-annotations:1.6.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/google/auto/value/auto-value-annotations/1.6.2/auto-value-annotations-1.6.2.jar
   > Could not find trove4j.jar (org.jetbrains.trove4j:trove4j:20160824).
     Searched in the following locations:
         https://jcenter.bintray.com/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
   > Could not find failureaccess.jar (com.google.guava:failureaccess:1.0.1).
     Searched in the following locations:
         https://jcenter.bintray.com/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar
   > Could not find j2objc-annotations.jar (com.google.j2objc:j2objc-annotations:1.1).
     Searched in the following locations:
         https://jcenter.bintray.com/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
   > Could not find jaxb-runtime.jar (org.glassfish.jaxb:jaxb-runtime:2.3.1).
     Searched in the following locations:
         https://jcenter.bintray.com/org/glassfish/jaxb/jaxb-runtime/2.3.1/jaxb-runtime-2.3.1.jar
   > Could not find stax-ex.jar (org.jvnet.staxex:stax-ex:1.8).
     Searched in the following locations:
         https://jcenter.bintray.com/org/jvnet/staxex/stax-ex/1.8/stax-ex-1.8.jar

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

 

是因为 引用的地址找不到了。需要添加 

 

buildscript {
    repositories {
        mavenCentral()
        google()
        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'

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

allprojects {
    repositories {
        mavenCentral()
        google()
        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        jcenter()
    }
}

 

需要添加 

mavenCentral()

maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'} jcenter()

 

参考 https://www.freesion.com/article/9380325153/

本文地址:https://blog.csdn.net/qq906786621/article/details/110670893

相关标签: android studio