如何在 android studio 中禁用 gradle '离线模式&#

How to disable gradle #39;offline mode#39; in android studio?(如何在 android studio 中禁用 gradle 离线模式?)

本文介绍了如何在 android studio 中禁用 gradle '离线模式'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 android studio IDE 开发的新手.每次导入在 android studio 中开发的示例项目时,都会出现此错误..

I am new to android studio IDE development. Every time when I imported a sample project that developed in the android studio, I am getting this error..

没有可用的 com.android.tools.build:gradle:1.1.0 缓存版本用于离线模式.禁用 Gradle '离线模式'并同步项目.

No cached version of com.android.tools.build:gradle:1.1.0 available for offline mode. Disable Gradle 'offline mode' and sync project.

我该如何解决这个问题.

How can I solve this problem.

推荐答案

Android Studio 3.6+ 中的新位置

查看 >工具窗口 >来自菜单栏的 Gradle.

View > Tool Windows > Gradle from the menu bar.

然后,在 Gradle 窗口顶部附近,单击 Gradle 面板中的 Toggle Offline Mode Gradle offline 按钮.

Then, near the top of the Gradle window, click Toggle Offline Mode Gradle offline button in the Gradle panel.

旧答案

在 Windows 上:-

转到文件->设置.

然后打开'Build,Execution,Deployment'.然后打开

构建工具 ->摇篮

然后取消选中 ->离线工作在右侧.

Then uncheck -> Offline work on the right.

点击确定按钮.

然后重建项目.

在 Mac 操作系统上:-

转到 Android Studio ->首选项,其余相同.或者按照图片中给出的步骤进行操作

go to Android Studio -> Preferences, and the rest is the same. OR follow steps given in the image

[

这篇关于如何在 android studio 中禁用 gradle '离线模式'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何在 android studio 中禁用 gradle '离线模式&#

基础教程推荐