I am trying to add commons-io-2.4.jar to my android studios project but there are no clear instructions on how to do it. Can someone show steps, in detail, on how to add the jar file to a project in Android Studios?
4
- 1Possible duplicate of Android Studio: Add jar as library?Lukas Knuth– Lukas Knuth2016-03-10 16:11:17 +00:00Commented Mar 10, 2016 at 16:11
- no, that is for another jar file. I want answers on the jar I'm trying to add, specifically. I've looked at others but none have gone into detail about how to properly add it.Nikita Davis– Nikita Davis2016-03-10 16:16:41 +00:00Commented Mar 10, 2016 at 16:16
- 2The process is exactly the same, no matter which Jar it is. You could just try it.Jonas Czech– Jonas Czech2016-03-10 16:24:25 +00:00Commented Mar 10, 2016 at 16:24
- I did. that process says to put the jar file into the libs folder. Where is the libs folder? Does that mean in Android Studios? Does it mean do it from the file explorer in Windows? If that means in Android Studios, how do I get to it? I don't see itNikita Davis– Nikita Davis2016-03-10 16:27:43 +00:00Commented Mar 10, 2016 at 16:27
Add a comment |
2 Answers
- Create a folder called 'libs' under your apps directory in Android studio for your project.
- Add the jar file.
in your build.gradle file:
dependencies { compile files ('libs/commons-io-2.4.jar') }
EDIT: here is what your directory structure should look like:
4 Comments
Nikita Davis
is that a java class? module? Android resource file? I don't see just "folder".
Nikita Davis
Ah...ok. That's where the disconnect was. I was under "Android" where I'm guessing everybody else was under "Project" (where the drop down menu is). Thank you for the screenshot. I'm getting a completely different error now saying "Supplied String module notation 'libs/commons-io-2.4.jar' is invalid". But that's better than seeing that other issue for 3 days straight.
Kristy Welsh
@NikitaDavis See edited answer, I forgot 'files' after compile.
Nikita Davis
thank you for your patience...that seem to have worked
