Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3.2 Generated 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

enter image description here

like image 619
Sandeep Parish Avatar asked Sep 28 '18 05:09

Sandeep Parish


People also ask

Which Java Edition is used in Android Studio?

The OpenJDK (Java Development Kit) is bundled with Android Studio. The installation is similar for all platforms.

Can we create Java project in Android Studio?

In an open Android Studio project, click File > New Module. Click More Modules > Java Library > Next, then fill in whatever you prefer for the names. A new module will appear as a folder on the same level as your "app" folder in the Project Structure. Open it and open the new Java class file.

Is Android Studio Java based?

Android Studio is the official integrated development environment (IDE) for Android application development. It is based on the IntelliJ IDEA, a Java integrated development environment for software, and incorporates its code editing and developer tools.


1 Answers

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.

like image 99
Daniel Zolnai Avatar answered Oct 09 '22 16:10

Daniel Zolnai