skip to Main Content

I know how to work with Apache Commons Lang 3 library in an Android Studio app by implementing it in the build.gradle file using implementation 'org.apache.commons:commons-lang3:3.12.0'. But I want to know if it’s possible to include the Apache Commons Lang 3 library (or for that matter, any external library) in the Android app manually if I have the library downloaded on my PC? For example, like adding the .jar file of the library to Android Studio or something of that sort.

I’m asking from the viewpoint where I have a library folder in my PC which doesn’t have an online link from which gradle can download and merge it with the Android Studio app automatically. How do I add that library to my Android app? Any elucidation on this matter is complimented.

Regards

2

Answers



  1. These are the steps to add a local library as dependency (.jar):

    • put the jar file into "libs" folder
    • add the following line to your build.gradle, inside dependencies:

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

    like:

    dependencies {
         compile fileTree(dir: 'libs', include: ['*.jar'])
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search