Android Studio – Add External Jar to Library (Project Dependencies)
There are many external libraries available that make many specific tasks simple and easy with the APIs and Classes they provide. In this tutorial, we shall learn how to import an External Jar file to the Project Module Dependencies in Android Studio.
For the demo purpose, we shall take a jar file named svg-android-1.1.jar.
To add an external jar to Project Module Dependencies
Step 1: Open Project Window and drop your jar file in libs folder under app.
Step 2: Open Project Structure.
Step 3: In the left panel, under Modules, click on app, Click on Dependencies Tab. On the right side,+ symbol would appear.
Step 4: Click on Jar Dependency
Step 5: Browse the Jar file under libs directory.
Step 6: The jar file would be added to the dependencies.
Once you click OK, Gradle Project Sync starts and Build happens.
We have successfully added the jar file to Project Dependencies and you may use the classes in it.
In this Kotlin Android Tutorial, we have learnt how to add an external jar file to Project Module Dependencies.