Gradle 任务未显示在 Android Studio 4.2 的 gradle 工具窗口中 [英] Gradle tasks are not showing in the gradle tool window in Android Studio 4.2

查看:47
本文介绍了Gradle 任务未显示在 Android Studio 4.2 的 gradle 工具窗口中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将 Android Studio 更新到了 4.2 版.我很惊讶在我的项目中没有看到 Gradle 任务.

I just updated Android Studio to version 4.2. I was surprised to not see the Gradle tasks in my project.

在之前的版本 4.1.3 中,我可以看到如下所示的任务:

In the previous version, 4.1.3, I could see the tasks as shown here:

但现在我只能看到 4.2 版本的依赖项:

But now I only see the dependencies in version 4.2:

我尝试清除 Android Studio 的缓存并再次同步我的项目,但没有任何变化.

I tried to clear Android Studio's cache and sync my project again, but there was no change.

这是功能更改吗?

推荐答案

好的,我找到了在 android studio 4.2 中出现这种行为的原因.

OK, I found why I got this behaviour in android studio 4.2.

这是预期的行为.我在这篇文章中找到了答案:https://issuetracker.google.com/issues/185420705.

It is intended behaviour. I found the answer in this post: https://issuetracker.google.com/issues/185420705.

Gradle 任务列表很大,而且在 Android 项目中填充速度很慢.出于性能原因,默认情况下禁用此功能.你可以重新启用它:设置 |实验 |不构建 Gradle 任务Gradle 同步期间的列表.

Gradle task list is large and slow to populate in Android projects. This feature by default is disabled for performance reasons. You can re-enable it in: Settings | Experimental | Do not build Gradle task list during Gradle sync.

通过单击将项目与 gradle 文件同步"重新加载 Gradle 项目;图标,任务就会出现.

Reload the Gradle project by clicking the "Sync Project with gradle Files" icon and the tasks will appear.

把这个实验性的变化放在 android studio 4.2 的发行说明中可能很酷.

It could be cool that this experimental change is put in the release note of android studio 4.2.

这篇关于Gradle 任务未显示在 Android Studio 4.2 的 gradle 工具窗口中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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