15

I am working on a project on Android Studio where I am using some libraries. But out of them one library/module is not of any use. Now I want to remove/delete that particular Module. But when I right clicked on that module no delete option shows. I then went to Android Project folder in my C Drive and deleted that module's folder. But still that empty module is showing in android studio. How to remove it totally??

8 Answers8

23

Go to File -> Project Structure -> Dependencies -> Select library/module -> click minus(-) -> Confirm selection from alert.

Alternative

If the above solution does not work then try this:

firstly remove the library from your build.gradle file and then delete it from the project structure.

Pro Mode
  • 1,453
  • 17
  • 30
19

Go to File > Project Structure > Select the module in modules and press minus(-) on the top left. This will remove the library but you will have to manually remove the files form your project . this link will help you in better understanding.

Community
  • 1
  • 1
Arpan Sharma
  • 2,142
  • 11
  • 22
7

Sometimes the modules won't be showing in the module settings dialog. You have to check the .idea folder and modules.xml file and manually remove the unwanted modules (take caution though).

Hope it helps someone.

Monster Brain
  • 1,950
  • 18
  • 28
  • 3
    had a problem where by i deleted the module manually not knowing there were particular steps to follow. Only your answer led me to deleting it properly and not have it show in the ide – Chief May 29 '20 at 23:10
  • 1
    Yes it indeed helped me :). But in my project it was modules.xml not .iml, any idea why? @Monster Brain – beginner Jul 29 '20 at 05:48
2

open build.gradle file, remove line which you dont want in your dependencies. clean and rebuild your project..

if you applying module, open setting.gradle, remove module from there

ZeroOne
  • 8,996
  • 4
  • 27
  • 45
2

Delete the path in build,grade(app) then Go to File > Project Structure > Select the module in modules and press minus(-) on the top left. This will remove the library but you will have to manually remove the files form your project .

Syed Danish Haider
  • 1,334
  • 11
  • 15
0

Just need to remove it from build.gradle(app)

   implementation(project(":core:yourLibraryModuleName"))

and then remove it from 'setting.gradle'

   include ':core:yourLibraryModuleName'

and finally, go to the project item to show your project files and delete your module and sync your project

Reza Zavareh
  • 187
  • 3
  • 7
0

just right-click on the module/library, click on Open In, and delete the folder.

Hanif Shaikh
  • 500
  • 1
  • 10
-1

Remove liebrary name from include in setting.Gradle from gradle Scripts

Yuvaan Chauhan
  • 344
  • 1
  • 3
  • 12