0

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
  • 1
    Possible duplicate of Android Studio: Add jar as library? Commented 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. Commented Mar 10, 2016 at 16:16
  • 2
    The process is exactly the same, no matter which Jar it is. You could just try it. Commented 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 it Commented Mar 10, 2016 at 16:27

2 Answers 2

1
  1. Create a folder called 'libs' under your apps directory in Android studio for your project.
  2. Add the jar file.
  3. in your build.gradle file:

    dependencies { compile files ('libs/commons-io-2.4.jar') } 

EDIT: here is what your directory structure should look like:

directory sturcture

Sign up to request clarification or add additional context in comments.

4 Comments

is that a java class? module? Android resource file? I don't see just "folder".
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.
@NikitaDavis See edited answer, I forgot 'files' after compile.
thank you for your patience...that seem to have worked
0

go to File -> Project Structure -> Modules -> app -> Dependencies click on green plus button and select File dependencies and chose your .jar file

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.