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

gradle下载不了包

程序员文章站 2022-03-04 09:09:26
...
Caused by: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find hamcrest-core.jar (org.hamcrest:hamcrest-core:1.3).
Searched in the following locations:
    http://xxx/repository/jcenter/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
	at org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult.notFound(DefaultBuildableArtifactResolveResult.java:27)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifactFromCache(CachingModuleComponentRepository.java:273)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifact(CachingModuleComponentRepository.java:257)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.BaseModuleComponentRepositoryAccess.resolveArtifact(BaseModuleComponentRepositoryAccess.java:64)

删掉或者重命名C:\Users\xx\.gradle
重启Android Studio




A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugUnitTestApkCo
py'.
   > Could not find junit:junit:4.12.
     Required by:
         project :app

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

BUILD FAILED

Total time: 7 mins 38.635 secs

gradle用3.3的,需要修改用2.3.3的插件,buildscript的classpath 用这个com.android.tools.build:gradle:2.3.3'





用了nexus的,看看是否设置了代理导致下不了内网的包
删掉gradle.properties文件的systemProp.http.proxyHost和systemProp.http.proxyPort