I create a project and upload it to github , then when I copy a project with git in a new place, Android Studio complains that no modules were found and indicates the absence of *iml files and the project is not visible in AS . Such a thing always appears when i use some additional dependency . After clicking "Refresh all Gradle projects", new *iml files are created and everything works.

Why is it so? Do I need to load *iml on git (that is, remove them from gitignore ) or should I gitignore it in the AS somewhere in the settings so that it automatically creates *iml ?

    1 answer 1

    If you fumble it as a Gradle project, which is actually recommended, then do not.

    If, however, as an IDEA project, then laziness is imported, then it is necessary.
    https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

    ADDON : Gradle project after downloading is not necessary to immediately open in Android Studio, but it is necessary to import into it, then all auxiliary files will be created, such as * .iml and the project will open correctly.

    • 2
      Если же как IDEA проект, лень потом импортировать such laziness must be eradicated! )) Gradle, Maven, SBT and other build systems are designed to store configuration and environment as a code and not version a bunch of files, especially binary ones. - Nick Volynkin
    • I don’t actually copy the project, but give a link to it in AS check out from project from VC => clone repositore . Isn't that the same thing as improt? And yet if I fill in *iml it will not harm anyone? - Bogdan Shulga
    • one
      No, this is not an import. That you simply use AS as a version control client. The same can be done from the command line or using other clients like Tortoise. - Eugene Krivenja
    • one
      So, after check out from project from VC studio will offer to open a project, I must say no. Then go to File -> New -> Import Project or somehow and import the downloaded file as a Gradle project. - Eugene Krivenja