Project already contains module with this name — Android Studio

前端 未结 15 951
长发绾君心
长发绾君心 2021-01-01 09:15

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:

相关标签:
15条回答
  • 2021-01-01 09:20

    Remove compile project(':module_name') from build.gradle under app folder

    then remove module folder under your Project Folder

    then remove your module name entry from settings.gradle

    0 讨论(0)
  • 2021-01-01 09:21

    This worked for me:

    In app/build.gradle, remove this line from dependencies {:

    implementation project(':library')
    

    In settings.gradle, change

    include ':app', ':library'
    

    to

    include ':app'
    

    Then you can import the library. Be sure to put the lines back into the gradle files you took out above.

    0 讨论(0)
  • 2021-01-01 09:27

    I solved this by removing the existing module from the project structure, then renaming the folder. It finally worked when I removed the folder, ran a sync, then re-added the folder and attempted to import.

    0 讨论(0)
  • 2021-01-01 09:31

    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.

    0 讨论(0)
  • 2021-01-01 09:32

    If shows this error after deleting the module from project structure then, select Project view of our project in android studio and then explore and the there will be the folder of module that we imported, right click on that and Delete it and rebuild the app.

    0 讨论(0)
  • 2021-01-01 09:34

    The project view on the left hand side, doesn't show 'everything' your project contains. You can switch the view from the drop-down menu, which is defaulted to 'Android' and change it to 'Project Files', which will probably show you where the problematic reference to the Module remains.

    Alternatively, just check on disk where your project is located. I found references in the main project folder.

    0 讨论(0)
提交回复
热议问题