I just deleted a module that contained the source code of my application. For this reason, I cannot debug and play my application in the emulator. In the Project view the folder does exist but in the android view doesn't exist.
Please help!
If you removed just the module not it's contents (through Project Structure dialog) and your module folder is now considered just a generic folder by Android Studio, here's how to bring it back:
Switch to Project
mode (of the Project
pane), open file .idea/modules.xml
(or just hit Ctrl[Cmd] + Shift + N
and search for modules.xml
)
Add a <module />
tag corresponding to your accidentally deleted module, do Gradle Sync and the module folder will once again be recognized as such.
Here's a sample
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/MODULE_NAME/MODULE_NAME.iml" filepath="$PROJECT_DIR$/MODULE_NAME/MODULE_NAME.iml" />
<module ...
</modules>
</component>
</project>
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