Can you regenerate a deleted modules .iml file in android studio

Solution 1:

If your project is Gradle-based, then click the Sync Project with Gradle Files button enter image description here in the toolbar and it will regenerate all .iml files.

If you can't locate this button , then just look at right for Gradle tasks -> select task -> right click -> refresh external dependency will bring you back modules and iml file.

Solution 2:

If you have not invalidated your cache or updated intellij since, locate the folder it used to be in > right click > Local history > show history. from here you should be able to restore that .iml file

Solution 3:

Reimport the module (our project is maven-based, but that shouldn't matter).

Go to file -> project structures -> modules -> import module (click the +)

Then simply select your module and click through the wizard.