5

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?

Community
  • 1
  • 1
EmJiHash
  • 623
  • 9
  • 22

3 Answers3

8

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.

EmJiHash
  • 623
  • 9
  • 22
6

if you right click an excluded directory in the Project View, you can select from the context menu:

Mark directory as → Cancel exclusion

Vojtech Ruzicka
  • 16,384
  • 15
  • 63
  • 66
  • I use android-studio 2.1 and it doesn't have the option "Mark directory as". should I add it somehow? Actually I checked it with IntelliJ on another computer and it has the feature. So, my bad. I will edit my question and limit it to just Android Studio. Thanks. – EmJiHash May 12 '16 at 14:44
0

You must delete .iml file then try to sync and it will work fine