How to add 'libs' folder in Android Studio?
Asked Answered
L

9

235

I need help in creating the 'libs' folder in Android Studio for my project (It is not auto-generated in my project).

When I want to create a folder, it gives me lots of options, like AIDL, Assets, JNI, Java, Java Resources, Renderscripts, and 'res' folders. I chose Res and added a libs folder but it didn't show up on my file structure on the left.

Can anyone help me?

I wanted to add a JAR file but I can't find libs to put in.

Lard answered 16/11, 2014 at 12:19 Comment(7)
just create it from a file explorer, it should work!Dilatory
Can you teach me in details? I have no idea where to create in. Here is my dir : C:\Users\Juicy\Desktop\Utranslator\app\src\main\res Is it here?Lard
It still does not show in my Android Project on my left hand side in Android Studio. I cant use my jarLard
then create the folder libs into c:/users/juicy/desktop/Utranslator/app/ ... It should show up, I think there's an icon to refresh the tree. Also, copy the library right away into the created dir with the file explorer, exit and re-run Android StudioDilatory
Sorry to say that its still not working. The libs file is like invisible in Android Studio but it exists in File ExplorerLard
sorry to hear that, unfortunately I cant be of much help because I dont have android studio installed at the moment, however there should be a refresh button somewhere! wish you luck!Dilatory
Could you accept one of reply as "answer".Teador
D
548

The solution for me was very simple (after 10 hours of searching). Above where your folders are there is a combobox that says "android" click it and choose "Project".

enter image description here

Deuteragonist answered 25/11, 2014 at 6:36 Comment(4)
yeah they did hide that folder. If the font for the library names are in orange does it have any meaning? Looking to end this torture...Micelle
Thanks for the answer. But can I get an explanation as to why it doesn't show up in the Android heading?Milt
wow.. and here I was wondering why there were so many ways to view my project. This combobox is just a combo of stupidity and needlessness in my opinion. How Eclipse did it before worked, just show us everything! Props for giving us the solution!Weinman
Thanks. Solved the issue. It's hilarious, that this view isn't the standard view in a Flutter project when you just created - a Flutter project. Maybe, there is a bit of work for the responsible developers here to be done...?Knacker
T
218

Click the left side dropdown menu "android" and choose "project" to see libs folders

enter image description here

*after choosing project you will see the libs directory

Timeout answered 19/1, 2015 at 8:35 Comment(0)
E
14

libs and Assets folder in Android Studio:

Create libs folder inside app folder and Asset folder inside main in the project directory by exploring project directory.

Now come back to Android Studio and switch the combo box from Android to Project. enjoy...

Endodontist answered 18/12, 2014 at 6:1 Comment(0)
S
8

also, to get the right arrow, right click and "Add as Library".enter image description here

Seritaserjeant answered 11/5, 2017 at 16:38 Comment(2)
Add as Library is not available with the new versions.Hellespont
Its available in electric eil 👍Quinidine
I
5

Another strange thing. You wont see the libs folder in Android Studio, unless you have at least 1 file in the folder. So, I had to go to the libs folder using File Explorer, and then place the jar file there. Then, it showed up in Android Studio.

Interested answered 6/8, 2016 at 23:35 Comment(0)
D
4

also you should click right button on mouse at your projectname and choose "open module settings" or press F4 button. Then on "dependencies" tab add your lib.jar to declare needed lib

Dardan answered 20/10, 2015 at 17:39 Comment(0)
Z
3

You can create lib folder inside app you press right click and select directory you named as libs its will be worked

Zashin answered 26/11, 2015 at 9:33 Comment(0)
T
1
  1. Open Android Studio, and click File > Project Structure.
  2. Redirect to Project Settings > Module.
  3. Select yourProjectName_android and remove it by clicking (-) minus sign shown on above.
  4. Now click on yourProjectName and click on + Add Content Root and just provide the path of your project.
  5. Just Apply and Ok.
  6. Restart your android studio.
Turgescent answered 12/12, 2023 at 12:55 Comment(0)
D
0

Right click on App and create new directory. enter image description here

Give the direcory name libs and save

enter image description here

Now you can see the libs folder.

Dysteleology answered 8/4 at 20:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.