android - 无法解决 ':app@debug/compileClasspath' : Could not resolve com. android.support :appcompat-v7:26. 1.0 的依赖关系

标签 android android-studio gradle android-gradle-plugin

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

无法解析 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.

错误日志:

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.

错误日志图片:

Click here for image

最佳答案

转到文件->其他设置->默认设置->构建、执行、部署->构建工具->Gradle->取消选中离线工作选项。

关于android - 无法解决 ':app@debug/compileClasspath' : Could not resolve com. android.support :appcompat-v7:26. 1.0 的依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46999594/

相关文章:

android - 在 Android Gradle 构建中禁用 list 合并

android - 方向改变时应用程序崩溃

java - 从类(class)中调用文本到语音,与 Activity 类(class)分开

Android Studio文件映射问题,无法识别文件

Android Studio :failed to resolve:com. 泄漏.slideswitch :app:1. 0.0

Android Studio 错误 Could not find method android() for arguments on module project

android - 根据方向动态调整表格布局的列和行

安卓工作室错误 : Execution failed for task ':app:processDebugResources'

java - EditText 到 String 到 double 转换及计算错误

java - Gradle在构建期间将属性值或文件从gradle中排除,本地