IntelliJ Android plugin: suppress generation of or change where it is written?-ThrowExceptions

Exception or error:

I am trying to stop IntelliJ from putting generated files in my primary source folder. These generated .java files are interfering with glob rules that I use with other tools. (Think find -name '*.java'.)

For Android development, I appear to be able to customize the output directory for and files generated from the AIDL compiler, but IntelliJ appears insistent on creating a gen/ directory and writing a file in my source tree. Is there anything that I can do to stop it?

I realize that normally, the gen/ folder is created alongside the src/ folder, but in my case, I am using something like:

<sourceFolder packagePrefix="com.example" />

so the gen/ directory that is created under com.example and looks like a new package (com.example.gen) whereas it is not.

How to solve:

click File->Project Structure->Facets,you can here found your android app,click Generated sources here, now you can set Directory for generated files here。

Leave a Reply

Your email address will not be published. Required fields are marked *