Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
无法解析com.android.support:appcompat-v7:26.1.0。要求:project:app
No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode.
错误:无法解析配置':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.
我想使项目脱机..如果我没有互联网连接..(对于新项目,请不要连接到互联网)
最佳答案
将AS更新到3.1.3后,我也遇到同样的问题
我的问题:
在同步gradle 时出现这些错误:-
错误:无法解析':app @ debug / compileClasspath'的依赖关系:无法解析xxx。
错误:无法解析':app @ debug / compileClasspath'的依赖关系:无法解析xxx。
错误:无法解析':app @ debugAndroidTest / compileClasspath'的依赖项:无法解析xxx。
错误:无法解析':app @ releaseUnitTest / compileClasspath'的依赖关系:无法解析xxx。
错误:无法解析':app @ debugAndroidTest / compileClasspath'的依赖项:无法解析xxx。
解决此问题的解决方案:
1 。在“SDK管理器”>“外观和行为”>“系统设置”>“HTTP代理”中检查代理。
应检查自动检测代理设置。
2 。默认设置生成,执行,部署>生成工具> Gradle
取消选中离线工作。
3 。在左侧面板中,选择Project Explorer> Android
检查Gradel脚本目录。查找cradle.properties(全局属性)
它包含代理添加的属性,请对所有属性进行评论。
尝试清理和构建。
现在检查所有依赖项解析。
关于android - 无法解决Android Studio 3.0.1中的所有依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48171692/