添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
豪气的电影票  ·  c++ - ...·  2 年前    · 
霸气的单车  ·  opencv 读取rtsp-掘金·  2 年前    · 

Android 卡在Gradle:Resolve dependencies’:app:_debugCompile’
的原因为Gradle默认每次编译都会resolve dependencies,每次都会去进行网络请求。
所以有两种方案可以解决该问题,一是网络请求步骤加快;二是不通过网络,使用本地文件。

1. 网络

resolve dependencies过慢,最大原因是访问库的速度太慢了,有可能是私有库地址访问太慢,也有可能是公共库,其中JCenter国内可能下载比较慢,所以推荐几个镜像库:
在工程下的 build.gradle 里面设置一下内容

allprojects {
    repositories {
        maven { 
        url 'http://maven.aliyun.com/nexus/content/groups/public'
        ······

这里设置了阿里云的maven库,速度测试还非常不错。
另外还有两个
http://mirrors.ibiblio.org/maven2/
http://maven.oschina.net/content/groups/public/
自测发现速度慢,所以不推荐使用。

2. 本地

offline模式下,需要保证所有的库已经正确下载完整,可以更改为offline模式。这里写图片描述

另外命令执行gradle task的时候,也会出现该情况,所以这个时候,执行命令的时候后面加入–offline就可以了。
user$ ./gradlew makeJar --offline
文章最后发布于: 2017-08-16

Could not resolve all dependencies for configuration ':app:debugRuntimeClass -- 解决方法

qq_27926839 1953次阅读 03-10 APP打开

用gradle构建springboot项目, 一直卡在Gradle: Resolve dependencies '....compileClasspath'解决办法

geming2017 961次阅读 11-28 APP打开

gradle升到4.4后,报Unable to resolve dependency for ':app@debug/compileClasspath':

magicbaby810 51744次阅读 04-08 APP打开

react-native :app:preReleaseBuild > Resolve dependencies of :app:releaseCompileClasspath > maven-met

WANG_CA 247次阅读 06-11 APP打开

NestJs | 依赖注入报错Nest can't resolve dependencies of the UsersController (?). Pleasemake sure that the

u011607490 1213次阅读 01-21 APP打开

android studio 3.0 preview 解决Gradle: Configure Project or Gradle: Resolve Dependencies ':classpath

LXX_Believe 6299次阅读 05-20 APP打开

android studio中出现gradle编译失败: Could not resolve all dependencies for configuration ':app:_debugApkCop

qq_14902389 26505次阅读 11-06 APP打开

【已解决】Could not resolve all dependencies for configuration ':app:_prodDebugApkCopy'.

wxx_csdn 9762次阅读 02-02 APP打开