无法解决 android studio 3.0.1 中的所有依赖项 [英] Unable to resolve all dependencies in android studio 3.0.1

查看:31
本文介绍了无法解决 android studio 3.0.1 中的所有依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法解析 ':app@debug/compileClasspath' 的依赖:无法解析 com.android.support:appcompat-v7:26.1.0.

无法解析 com.android.support:appcompat-v7:26.1.0.需要:项目 :app

Could not resolve com.android.support:appcompat-v7:26.1.0. Required by: project :app

No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode.

错误:无法解析配置:app:debugCompileClasspath"的所有文件.

Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.

Could not resolve com.android.support:appcompat-v7:26.1.0. Required by: project :app No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode. No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode. Could not resolve com.android.support.constraint:constraint-layout:1.1.0-beta3. Required by: project :app No cached version of com.android.support.constraint:constraint-layout:1.1.0-beta3 available for offline mode. No cached version of com.android.support.constraint:constraint-layout:1.1.0-beta3 available for offline mode. Could not resolve com.android.support:design:26.1.0. Required by: project :app No cached version of com.android.support:design:26.1.0 available for offline mode. No cached version of com.android.support:design:26.1.0 available for offline mode. Could not resolve com.android.support:cardview-v7:26.1.0. Required by: project :app No cached version of com.android.support:cardview-v7:26.1.0 available for offline mode. No cached version of com.android.support:cardview-v7:26.1.0 available for offline mode. Could not resolve com.google.android.gms:play-services-ads:11.4.2. Required by: project :app No cached version of com.google.android.gms:play-services-ads:11.4.2 available for offline mode. No cached version of com.google.android.gms:play-services-ads:11.4.2 available for offline mode. Could not resolve com.android.support:support-v4:26.1.0. Required by: project :app No cached version of com.android.support:support-v4:26.1.0 available for offline mode. No cached version of com.android.support:support-v4:26.1.0 available for offline mode.

我想让项目离线..如果我没有互联网连接..(对于未连接互联网的新项目)

I want to make project offline.. if I dont have internet connection.. (For new project not connect to internet)

推荐答案

我在将 AS 更新到 3.1.3 后遇到了同样的问题我的问题:

I have same issue after updating AS to 3.1.3 Issues with me:

我在同步 gradle 时遇到这些错误:-

错误:无法解析:app@debug/compileClasspath"的依赖关系:无法解析 xxx.

Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve xxx.

错误:无法解析:app@debug/compileClasspath"的依赖关系:无法解析 xxx.

Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve xxx.

错误:无法解析:app@debugAndroidTest/compileClasspath"的依赖关系:无法解析 xxx.

Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve xxx.

错误:无法解析:app@releaseUnitTest/compileClasspath"的依赖关系:无法解析 xxx.

Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve xxx.

错误:无法解析:app@debugAndroidTest/compileClasspath"的依赖关系:无法解析 xxx.

Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve xxx.

解决此问题的解决方案:

1.在 SDK Manager > Appearance & 中检查代理行为 > 系统设置 > HTTP 代理.应检查自动检测代理设置.

1. Check proxy in SDK Manager > Appearance & Behavior > System Settings>HTTP Proxy. Auto-detect proxy settings should be checked.

2.默认设置构建、执行、部署 > 构建工具 > Gradle取消选中离线工作.

2. Default settings Build, Execution, Deployment > Build Tools > Gradle Uncheck Offline work.

3.在左侧面板中选择 Project explorer > Android检查 Gradel 脚本目录.寻找 cradle.properties(全局属性)它包含代理添加的属性,请对所有属性进行评论.

3. In left side panel select Project explorer > Android Check Gradel Scripts dir. look for cradle.properties (Global Properties) It contains proxy added properties please do commented all of them.

尝试清理和构建.

现在检查所有依赖项是否解决.

Now check all dependencies resolve.

这篇关于无法解决 android studio 3.0.1 中的所有依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆