Project already contains module with this name -- Android Studio
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.
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.
I have encountered this.And I deleted the folder which below my project with the module name I set before, then I can import a module with same name again.
Hope this helps you.