Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 998
Fuad Avatar asked Dec 14 '22 13:12

Fuad


2 Answers

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

like image 170
yushulx Avatar answered Dec 21 '22 09:12

yushulx


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.

like image 31
Ye Lin Aung Avatar answered Dec 21 '22 11:12

Ye Lin Aung