External jar as dependency in Android Studio

To add an external jar as library in Android Studio, follow the below given steps:

Step 1: Open your project in Android Studio. By default it open in Android explorer mode as shown in below given image.

Android explorer

Step 2: Click on small button showing right side of Android and select Project

Step 3: Navigate to YourProject -> Build ->libs and paste your jar in lib folder as shown in below given image.

project explorer build->libs

Step 4: Select your jar and right click, that will open a window as shown in image. Click on Add As Library ...

Add as library

Step 5: Previous step open a popup, select your app module and click Ok button.

Create library

Step 6: Ensure that your compiled file added in build.gradle(Module: app). Clean and Build your project to finish the process.

Share & Like

Tutorial topics

About ApnaTutorials.com

ApnaTutorials.com is for Java, J2ee, Html5 and android developers. All tutorials are well explained and are easy to understand. We have tested every tutorials on our developement environment before posting it in public domain.