I need to write a lot of trivial modules and I don’t want to hide the main modules between them. For this reason I want to have a directory tree like this:
Project |-module1 |-module2 +-directory |-module3 |-module4 +-module5
The problem: if I move the modules inside a new folder Android Studio doesn’t find them.
So, my question is: How can I move modules inside a directory?
I would recommend closing the project in Android Studio, moving the directories manually in your OS, and updating the project’s settings.gradle file to point to the modules in their new location. Using your example, the updated settings.gradle file will look like this:
include ':module1' include ':module2' include ':directory:module3' include ':directory:module4' include ':directory:module5'
Then re-open the project in Android Studio, and make sure it syncs the project with the new Gradle files (which it should do automatically, but if it doesn’t, click the toolbar button for it).
Answered By – Scott Barta