Daniel K Daniel K - 3 months ago 17x
Android Question

How do I know that I've imported a jar properly in AndroidStudio project

I'm trying to use a third party library in AndroidStudio and am having some problems, it is the JSch library.

What I did was download the ".jar file
On my app within Module Settings I added it
And then selecting the app module again I added it within the dependencies

Yet when I try to code it into my files through "import com." it does not show.

I am too new at this to know if I added it incorrectly or if it has a problem within the ".jar" file.

Does this ring a bell with anyone who might know what I am doing wrong?


Just follow this steps:

1.- Put the jar into the libs folder

2.- Right click it and select "Add as library"

3.- Check that your build.gradle file contains:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar']) 

You'll provably need to do a clean build