If your project is Gradle-based, then click the Sync Project with Gradle Files button 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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…