Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove generatedJava from android studio 3.2

Android studio 3.2

enter image description here

I have migrated my project to android studio 3.2. After migration I see generatedJava folder in my Android folder structure. I don't have any use of it.

How can I remove this generatedJava folder from Android Studio?

like image 307
Bhuvanesh BS Avatar asked Sep 19 '18 07:09

Bhuvanesh BS


2 Answers

You can't actually remove it since it has been in your project also before:

build/generated/source/r/<current flavor>/<current build type>/
  • Refer to this answer.

But now, it reappear in the Android view mode of the project so that we can use for our purposes. There has been many topics like this before and unfortunately I couldn't find anything related to remove or hiding this in the Android Studio.

You also, if you remove it, it will reappear again since it is auto-generated by Android Studio so, perhaps this is gonna be a feature request for the next releases of Android Studio IDE itself.

Also, as mentioned, it can be helpful but, since it is added in the Android view mode, looks weird and unfamiliar. But there is no harm of seeing it in there.

Sorry to disappoint you

like image 56
ʍѳђઽ૯ท Avatar answered Oct 21 '22 10:10

ʍѳђઽ૯ท


Why you want to remove this?

Here is some explanation behind the reason to keep it as it is.

No one forces you to look into this folder. But if your project has a lot of generated code (room, data binding, dagger) then it is very handy to have quick access to these files in order to check if they were generated properly, set some breakpoints for debugging etc...

I really do not see anything bad about this folder being visible. In addition if its in the "generated" folder, then everyone could understand the contents are dynamic.

In addition it is good even for beginners to see that their code causes some generated code also. They will understand faster that it is not black magic happening behind room, dagger, data binding etc by seeing what is the actual code generated for a short annotation.

like image 39
0xAliHn Avatar answered Oct 21 '22 11:10

0xAliHn