关于Android studio同步时的异常问题(同步时出现的问题,这该怎么解决。已经两周了。救救孩子吧)
ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download junit.jar (junit:junit:4.12)
Show Details
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download hamcrest-integration.jar (org.hamcrest:hamcrest-integration:1.3)
Show Details
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download hamcrest-library.jar (org.hamcrest:hamcrest-library:1.3)
Show Details
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download hamcrest-core.jar (org.hamcrest:hamcrest-core:1.3)
Show Details
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download javawriter.jar (com.squareup:javawriter:2.1.1)
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download jsr305.jar (com.google.code.findbugs:jsr305:2.0.1)
Show Details
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not download junit.jar (junit:junit:4.12)
Show Details
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not download hamcrest-core.jar (org.hamcrest:hamcrest-core:1.3)
Show Details
Affected Modules: app

1个回答

基本上是谷歌连不上

你根目录的build.gradle里的2个repositories改成下面

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

问答版主就是牛,从现在起只回论坛,不在踏入问答半步

HG0724
我是程序昊 没用的,基本上网络上都找了一圈了,能出现的解决方案我都尝试了都是不行
7 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问