Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project already contains module with this name -- Android Studio

I had successfully imported a Module in my Application project in Android Studio. Then I deleted or removed the module by following the below link:

How to delete a module in Android Studio

I also removed the project module from the dependencies of my build.gradle(app) file.

Now, When I need to again include the same module project in my Andorid Application, it doesn't allows me, and gives the Project already contains module with the same name error.

I had check in my Project, Package, Android Structure but the project module which i need to Import and add as a Module Project is not there but still it say it already exist.

Can anyone help me to overcome this issue.??

like image 353
Pravinsingh Waghela Avatar asked Oct 16 '15 13:10

Pravinsingh Waghela


People also ask

What are the module in Android app?

Modules. A module is a collection of source files and build settings that allow you to divide your project into discrete units of functionality. Your project can have one or many modules, and one module may use another module as a dependency. You can independently build, test, and debug each module.


3 Answers

If somebody faces this issue, except removing the Folder containing the old module also remove from the settings.gradle file the line corresponding to the old module: include ':youroldmodule'. If you dont remove that line manually, 2 modules with the same name will appear when trying to add module dependency.

like image 72
eldjon Avatar answered Nov 13 '22 18:11

eldjon


Switch to the Project View. Then open .idea/modules.xml. Find and delete the line that corresponds to the module. Then Invalidate Caches and Restart. That's it.

like image 35
Kwabena Berko Avatar answered Nov 13 '22 17:11

Kwabena Berko


I solved the problem through this way:

  1. Open Module Settings(Mac: command + down; Windows: F4) and delete the module.
  2. Delete the module folder on the disk. You will find it at ~/AndroidStdioProjects/YourApplicationName/ModuleName.
  3. Import the Module.
like image 25
LunaElf Avatar answered Nov 13 '22 17:11

LunaElf