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 Studio 生成签名的 apk

java - 如何在Intellij中使用Gradle构建OpenFire插件?

java - Gradle构建错误:任务 ':app:prepareDebugDependencies'的执行失败

java - Gradle:在构建文件中将依赖项声明为属性有什么好处?

android - 读取 LatLngs 的 csv 文件,添加到 ArrayList,然后打印到谷歌地图 fragment

android - 如何在 Xamarin.Forms Android 微调器中更改日期顺序(从默认到日/月/年)?

android - 如何在 Eclipse 中打开 Android Studio 项目?

android - Android Rect对象中的top,left,right和bottom是什么意思

android - 将 PTT 选项添加到 Android 应用程序

android - 如果 webview 中的 url 相同,如何开始第三个 Activity