无法解析com.android.support:appcompat-v7:26.1.0 . 要求:项目: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.
我想使项目脱机..如果我没有互联网连接..(对于新项目没有连接到互联网)
1 回答
将AS更新到3.1.3后,我遇到同样的问题:
I am getting these errors while syncing gradle : -
错误:无法解析':app @ debug / compileClasspath'的依赖项:无法解析xxx .
错误:无法解析':app @ debug / compileClasspath'的依赖项:无法解析xxx .
错误:无法解析':app @ debugAndroidTest / compileClasspath'的依赖项:无法解析xxx .
错误:无法解析':app @ releaseUnitTest / compileClasspath'的依赖关系:无法解析xxx .
错误:无法解析':app @ debugAndroidTest / compileClasspath'的依赖项:无法解析xxx .
Solution for fix this issue :
1 . 在SDK Manager>外观和行为>系统设置> HTTP代理中检查代理 . 应检查自动检测代理设置 .
2 . 默认设置构建,执行,部署>构建工具> Gradle取消选中脱机工作 .
3 . 在左侧面板中选择Project explorer> Android Check Gradel Scripts目录 . 查找cradle.properties(全局属性)它包含代理添加的属性请注释所有这些属性 .
Try to clean and build.
现在检查所有依赖项解析 .