Search code examples
android-studiointellij-idea

How to re-include an excluded directory in Android Studio?


It's explained how to exclude a directory in Android Studio here. It also has a warning about not knowing how to include it back again. Now I need to do so.

Of-course I can create/import the project again. But I guess there's a better way of doing that. Is there? How?


Solution

  • As there is no "Mark directory as" menu in Android Studio, I found out that such settings like including and excluding directories are stored in a ".iml" file. Named like "project-name.iml".

    A line like bellow is used to exclude a dir:

    <excludeFolder url="file://$MODULE_DIR$/src/main/blah/blah/blah/" />
    

    So, Re-including is done as easily as removing the line.