如何清除缓存的摇篮? [英] How to clear gradle cache?

查看:469
本文介绍了如何清除缓存的摇篮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用Android工作室,和我第一次启动它,它需要像45分钟编译...如果我不退出应用程序,它是好的 - 每个随后的编译/运行应用程序将需要像45秒。

I'm trying to use Android Studio, and the first time I boot it up, it takes like 45 MINUTES to compile... If I don't quit the application, it is okay - each subsequent compilation/running the app will take like 45 seconds.

我试图来检查我的一些缓存:有一个 .gradle /缓存文件夹在我的主目录和它像123 MB大

I've tried to check some of my caches: there's a .gradle/caches folder in my home directory, and it's like 123 MB large.

还有一个 .gradle 文件夹在我的项目文件夹...的 taskArtifacts 就像200 MB 1 。我吓得只是随机核武器炸他们。文件夹的什么部分可以安全删除?

There's also a .gradle folder in my project folder... one of the taskArtifacts was like 200 MB. I'm scared to just randomly nuke them both. What parts of the folders are safe to delete?

是否有为什么我的机器人工作室正在采取永远在第一次运行摇篮组装任务加载的应用程序更好的解释?

Is there a better explanation for why my Android Studio is taking forever to run the gradle assemble task upon first time loading the application?

难道我还需要清除的IntelliJ缓存呢?

Do I also have to clear the intellij cache too?

推荐答案

您可以安全地删除位于项目目录下的整个 .gradle 文件夹。它会在每次任务运行时重新创建。同样是 .gradle 主目录下。它还将被重新创建为好,但整体的依赖必须重新下载 - 这是相当耗时的。

You can safely delete the whole .gradle folder located under project directory. It'll be recreated every time the tasks are run. The same is for .gradle under home directory. It'll also be recreated as well, but the whole dependencies must be downloaded again - it's quite time-consuming.

正如我在不同的地方通过网络摇篮的Andr​​oid开发看到的是相当缓慢,人们抱怨。不知道是什么原因正是 - 这是它的工作原理

As I see in various places over the web gradle for android development is quite slow and people complain about it. No idea what's reason exactly - this is how it works.

我不认为性能低是因为大的文件夹。其实他们帮助它更快。

I don't think that low performance is because of big folders. Actually they help it to be faster.

作为@ Bradford20000指出,在评论中,有可能还不 gradle.properties 以及位于 $ HOME / .gradle全球摇篮脚本。在这种情况下,删除该目录的内容时特别要注意。

As @Bradford20000 pointed out in the comments, there might might gradle.properties as well as global gradle scripts located under $HOME/.gradle. In such case special attention must be paid when deleting the content of this directory.

这篇关于如何清除缓存的摇篮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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