Android studio how to delete a folder with links?

I would like to delete one folder (unused library) from my project in Android Studio. But I can’t do this by deleting the key on the keyboard or in any other way.

I tried to find delete in the file refactor-> safe delete, but this option is disabled.

If I manually deleted the folder from the folder, Android Studio created the folder again and placed it in one .iml file, so I cannot delete the folder again.

Thanks for any help.

+6
source share
3 answers
  • Remove from settings .gradle
  • Build β†’ Clear (the blue rectangle should disappear)
  • Right-click on the module β†’ Delete
+18
source

To remove a module, you first need to remove it from .idea/modules.xml .

Once you do this and save the file, you can delete the folder that will no longer be marked with the blue rectangle of the module.

Remember to remove the module from settings.gradle .

I found this aswer to delete a project in android Studio 0.3.4

+6
source

The problem arises due to workspace.xml and modules.xml inside the .idea directory of your project.

You cannot remove any module if it has a blue rectangle on it. Follow the instructions to remove the module from the project:

  • Go to File> Project Structure, select the module you want to remove, and click the Red Minus button to delete.

    Note. Also remove if any link in the build.gradle file of your main module.

  • Clean your project using Build> Clean Project

  • Close your Android studio now

  • Go to the project directory and delete the file your_project.iml and the contents of the .idea folder from the project root directory, and also delete the directory of the module that you want to delete.

  • Open Android Studio again and let it sync the project with gradle

  • If the module appears again, it will not have a blue rectangle shortcut, so you can remove it with the right mouse button> delete and clear the project.

  • Synchronize your project with gradle, if it appears again, check the event log, if something is used somewhere from the library, if it removes them all. Check your File > Project structure if there is any error related to your module library below. If he uses the red lamp button, remove it.

  • After deleting all things Clean the project and sync it again.

Let me know in the comments if there is any problem.

+4
source

All Articles