I've just created a Multi project setup for my Android project in Android Studio as suggested by Gradle Plugin User Guide. Here is the file structure I have
MyProject/
| settings.gradle
| build.gradle
| MyProject.iml
+ app/
| build.gradle
| app.iml
+ libraries/
+ lib1/
| build.gradle
| lib1.iml
There is three modules in this configuration - MyProjects.iml, app.iml and lib1.iml. Although everything works just fine and project builds successfully, there is one annoying issue with it. Android Studio constantly creates a libraries.iml file under libraries folder and makes that folder a module.
That's why is the question. Is this a normal behaviour and - if not - how to get rid of it?
I tried to remove libraries.iml file and update MyProject.iml with no luck. The file appears again and again.
Update & final solution: To avoid all that hassle with generated files distracting our attention, I configured Android Studio to not show them at the end.
File (Android Studio on Mac) -> Preferences... -> File Types -> Ignore
files and folders: .DS_Store;.git;*.iml;.idea;
You specified 'libraries' as a parent module for your 'lib1' module. If you do not need to have such parent module, you can change your settings.gradle from
include ':app', ':libraries:lib1'
to
include ':app', 'libraries/lib1'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With