How to create a directory folder in Android Studio?
Solution 1
Try to create package instead of a directory. Seems like Create New Package and Create New Directory will both just create a folder under lib directory.
Solution 2
You need to go File -> Project structure. Select lib folder and unmark as source
Solution 3
Right click on the package then "Mark Directory as" -> Unmark as Sources Root. All child packages will be seen as folders.
Solution 4
I found a solution that worked for me In Mac OS,
1- Click over file and select project structure
2 - After, you should click on the lib folder, then unselect the "Source" from top
3- Then, click on Apply then Ok Buttons
4- Now when you try to create a directory on lib you will found the Directory option appears.
Hopefully, that's what you need.
Solution 5
Yeah I had the same problem, so you just have to follow these steps:
1) Go to project structure Here:
2) Go to Modules and find "Sources" tab Click here
3) Uncheck Sources and click "Apply"! (at the beginning it was unchecked and it didn't work, but when I checked "Sources", my folders changed as it was at the beginning(like packages), so I unchecked again and folders changed, and now I can create directories, not packages, hope it helped you!)
Husna
Updated on January 19, 2021Comments
-
Husna over 3 years
I'm using Android Studio and I want to create a directory folder inside the lib folder. I right-clicked on the lib folder but the directory option is not showing. Can anyone suggest to me how to create a directory folder inside a folder?
-
Husna almost 6 yearsbut I want to create inside lib folder. How should I create?
-
Sachin Soma over 5 yearsCreating nesting directory with packages looks like package1.pakage2
-
Jean-François Fabre over 4 years"Another option". Okay, what's the original option? your answer is supposed to stand for itself.
-
Franco Rojas almost 4 yearswhy does it work only with "raw" and not for another name?
-
David Crow almost 4 yearsDoes this have unintended side effects? It seems like the lib folder should be the sources root.
-
Usama Abdulrehman almost 4 yearsCan you simplify your answer in steps so its understood easily.
-
Admin almost 4 yearsKindly see the above edited answer hope it may help you solve your problem.
-
JAHelia about 3 yearsthis will disable indexing and so many behind the scenes functions in Android Studio