Gradle 同步失败 Android Studio 3.6 [英] Gradle Sync Failed Android Studio 3.6

查看:47
本文介绍了Gradle 同步失败 Android Studio 3.6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将 Android Studio 从 3.5.3 更新到 3.6.在这次更新之后,我也更新了 Gradle 和 Android SDK 构建工具.现在 Gradle 同步失败并出现以下错误:

I have just updated the Android Studio from 3.5.3 to 3.6. After this update, I have updated the Gradle and Android SDK Build Tools as well. Now the Gradle sync is failing with these errors:

1. org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException:
    Could not resolve all artifacts for configuration ':classpath'.
 2. org.gradle.internal.resolve.ModuleVersionResolveException: Could not
    resolve com.android.tools.build:gradle:3.6.0.
 3. org.gradle.internal.resolve.ModuleVersionResolveException: No cached
    version of com.android.tools.build:gradle:3.6.0 available for
    offline mode.

查看第三个错误,似乎需要在 Android Studio 设置 -> 构建、执行、部署 -> Gradle 中禁用 离线工作 选项.但是在上述设置中找不到离线工作复选框.这是实际问题吗?如果是,那么如何在 Android Studio 3.6 中禁用它?如果不是,那么这里的问题是什么?

Looking at the 3rd error it seems that Offline Work option needs to be disabled in Android Studio Settings -> Build, Execution, Deployment -> Gradle. But the Offline Work check box is no where to be found in the said settings. Is it the actual problem? If yes, then how it could be disabled in Android Studio 3.6? If no, then what is the problem here?

我已经尝试过使缓存无效/重新启动,但没有帮助.

I have already tried Invalidate Caches / Restart but it did not help.

推荐答案

不久前运行到同样的错误.这对我有用.

Run to the very same error a while ago. This worked for me.

来自 Android Studio 3.6 新功能博客文章:切换 Gradle 离线模式的新位置 要启用或禁用 Gradle 离线模式,首先从菜单栏中选择查看 > 工具窗口 > Gradle.然后,在 Gradle 窗口顶部附近,单击 Gradle 面板中的 Toggle Offline Mode Gradle offline 按钮

来源:无法在 Android 上启用 Gradle 的离线模式工作室 3.6

这篇关于Gradle 同步失败 Android Studio 3.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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