更新到新的Android Studio 3.1.2 [英] Updating to new Android studio 3.1.2

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

问题描述

我刚刚更新了Android Studio,但遇到了这个烦人的错误

I just updated my Android studio and I am get this annoying error

错误:无法下载builder.jar(com.android.tools.build:builder:3.1.2):没有可用于离线模式的缓存版本

Error: Could not download builder.jar (com.android.tools.build:builder:3.1.2): No cached version available for offline mode

推荐答案

此错误告诉gradle没有 com.android.tools.build:builder:3.1.2 的脱机文件,并且可能不能以离线模式下载.因此,您将禁用android studio的离线模式.

This error telling that gradle does not have offline files for com.android.tools.build:builder:3.1.2 and could not be downloaded in offline mode. So you will disable offline mode of android studio.

转到文件->设置.

然后打开构建,执行,部署",然后打开构建工具"->"Gradle".

And open the 'Build,Execution,Deployment',Then open the 'Build Tools' -> 'Gradle'.

然后取消选中右侧的离线工作".

Then uncheck "Offline work" on the right.

点击确定"按钮.

然后重建项目.

对于Mac,请转到AndroidStudio->偏好设置",其余部分相同.

For Mac go to AndroidStudio -> Preferences, rest is same.

您在这里.

什么是离线模式:

现在让我们讨论脱机模式,如果要脱机工作,可以在设置中检查脱机模式.如果您已选中此选项,则Gradle将使用缓存进行依赖项解析.如果文件不在缓存中,则将导致生成错误.您可能会遇到一些错误,如果添加一些依赖项,则Gradle将无法解决它,因为它将查看缓存本身.您可能会看到同步失败的错误.万一您收到此错误.只需取消选中离线模式并再次同步,然后再次检查离线模式即可.如果您必须继续添加依赖项,那么对于gradle系统而言,完全脱机工作非常困难.

Now let' talk about offline mode, if you want to work offline, you can check the offline mode in the settings. If you have checked this option, Gradle will use the cache for dependency resolution. If the files are not there in the cache, then it will result in a build error. You might get some errors, if you add some dependency, Gradle will not be able to resolve it since it's going to look into the cache itself.You might see a failed to sync error. In case you receive this error. Just uncheck the offline mode and sync again and then check the offline mode again. Completely offline work is very difficult with the gradle system if you have to keep adding dependencies.

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

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