Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio adds libraries.iml file

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;
like image 768
sergej shafarenka Avatar asked Nov 18 '25 16:11

sergej shafarenka


1 Answers

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'
like image 68
Vladislav Soroka Avatar answered Nov 20 '25 06:11

Vladislav Soroka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!