Project already contains module with this name — Android Studio

前端 未结 15 953
长发绾君心
长发绾君心 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:35

    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.

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

    You can't import a module if you've put the code for the module in the place it will end up being copied to. I had the module source code placed in the project root folder and it failed to import with the above message. If you move the code away somewhere, on import Android Studio will copy the code in.

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

    I am Not Sure but I hope it's Help you.

    Step 1: Pressed Alt + 1 for get Focus of your App.

    Step 2: Now Pressed F4 for open Module structure of Project

    Step 3 Now Select Dependencies and Remove All Extra dependencies of your project.

    than Pressed OK.

    and Resync gradle.

    I hope you are clear with my solution.

    Best Luck

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

    In one condition if you have copy a folder like this

    rootProject/module1
    

    if you import module android studio will find if you have same name folder. if you have it is not import android studio will tell you you have contains this module ,you just add this in setting.gradle like

    include ':modlue1'
    
    0 讨论(0)
  • 2021-01-01 09:42

    I had this problem when I was trying to add junit 4.12 to my project.First of all I delete old junit codes in dependencies of my build.gradle(app) file manually.Next I deleted the old junit.jar from my library with deleting libs folder and then create new libs folder directory in my app for add library.and for the end.......I find the old junit FILE near the end of project view after gradle folder....you can see in this image......and I deleted it.now I can add new module very easy and without same name error.sorry for bad english!! look this image for last order

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

    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.

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