Android Studio 3.2生成的Java [英] Android Studio 3.2 Generated java

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

问题描述

我刚刚更新了android studio的最新版本,这是一个名为Generated Java的新目录,如果我从项目的根目录删除此目录,谁能解释这是什么并对项目有什么影响.

如果您对此一无所知,请告诉我.

谢谢

解决方案

此文件夹已经在您的项目中,只是现在在项目浏览器的Android视图模式下突出显示了该文件夹.它的位置实际上是build/generated/source/r/<current flavor>/<current build type>/.

您可以在此处找到的类是将要从中构建项目的所有类,包括库. 当您在生成的代码(例如注释处理器)中遇到问题时,检查它们可能会很有用.例如,数据绑定库,ButterKnife或Dagger 2都会根据您的注释生成Java类,您可以在此目录中看到它们.

如果删除目录,它将使下一个构建速度变慢,因为它需要再次重新生成这些文件,而不是重新使用它们. 这意味着它们无论如何都会重新出现,所以这样做是没有意义的.

I just updated android studio in latest version and here is a new directory named Generated Java, can anyone explain what is it and any effect on projects if I delete this directory from root directory of project.

Please let me know if you know anything about it.

Thanks

解决方案

This folder has already been in your project, only now it is highlighted in the Android view mode of the project explorer. Its location is actually build/generated/source/r/<current flavor>/<current build type>/.

The classes you can find here are all the classes the project will be built from, including the libraries. Inspecting these could be useful when you are having issues with generated code, such as annotation processors. For example, the databinding library, ButterKnife, or Dagger 2 all generate java classes based on your annotations, which you can see in this directory.

If you delete the directory, it will make the next build slower, because it needs to regenerate these files again, instead of reusing them. Which means they will reappear anyways, so there's no point in doing that.

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

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