Fuad
Fuad

Reputation: 1509

In Android Studio, cannot delete unnecessary folder

Say I want to remove the 'facebook' folder. When I right click on that folder, and go to refactor, the delete option is grayed out. But I want to delete it. I also tried selecting the folder and pressing delete on the keyboard. Still could not delete.

enter image description here

enter image description here

Upvotes: 4

Views: 4908

Answers (4)

Adam
Adam

Reputation: 1

If you are running on Linux but the project is located in a driver you mounted from windows, move it to the Linux local file system, I just figured it out when I was in this situation. Good luck.

Upvotes: 0

Kishan Vaghela
Kishan Vaghela

Reputation: 7938

Right click on project -> Open Module Settings

enter image description here

Select your Module Folder and delete it.

enter image description here

Upvotes: 1

yushulx
yushulx

Reputation: 12140

You can switch to Project and delete it.

Here is my example. I have created a JNI module (the highlighted folder) in my project:

enter image description here

Now you just need to switch from "Android" to "Project" and click delete:

enter image description here

Upvotes: 10

Ye Lin Aung
Ye Lin Aung

Reputation: 11459

Part of the reason might be that the facebook (sdk) folder is part of your project (in used in your project) now and Android Studio doesn't let you do that.

If so, I am sure it will be in the settings.gradle as follow.

include ':facebook'

and in your app folder build.gradle, at the below, there's the dependencies and the folder would be included as follow.

compile project(':facebook')

Remove those lines and try removing it.

You can manually remove the folder as well but it's a good practice you remove it from the IDE because the IDE will check whether it's safe to do so.

Upvotes: 1

Related Questions