Android Studio–Add local jar / library to project

Hi recently I want to add third party module to my project. However I want don’t to use that slow gradle to download it. I downloaded the required jars. Now I had to import it to my project.

I tried method #1
Right Click project –>New –> Module –> Import .JAR/.AAR project-> Select my library and finish. However this still didn’t work for me.

Method #2 
this worked !
  • Change my project view from “android” to “Project”
  • Create “libs” folder.
  • Copied my .jar to this folder.
  • Right click the added .JAR and select “Add Library”.
  • Check your build.gradle below lines will be present
  • compile files('libs/android-async-http-1.4.9.jar')

#Method 3

To add any imported library project to the current application. Open build.gradle and add line

compile project(path: ':projectname')


dependencies {
 compile fileTree(dir: 'libs', include: ['*.jar'])
 compile ''
compile ''
compile ''
testCompile 'junit:junit:4.12'
compile project(path: ':projectname') 

Post a Comment

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !