You can right-click on the project, click on export, type 'jar', choose 'Runnable JAR File Export'. There you have the option 'Extract required libraries into generated JAR'.
A late answer, although I thought of giving an in-depth answer to this question. This method is suitable for Android Studio 1.0.0 and above.
STEPS
Now you can start using the library in your project.
Add your jar file to the folder app/libs
. Then right click the jar file and click "add as library".
If there is no libs
folder you can create it. Click on the combo box that says "Android", and change it to "Project"
From here, you can right click on "apps" in the directory tree and go to "New" => "Directory"
Put your JAR in app/libs, and in app/build.gradle add in the dependencies
section:
implementation fileTree(dir: 'libs', include: ['*.jar'])
Create "libs" folder in app directory copy your jar file in libs folder right click on your jar file in Android Studio and Add As library... Then open build.gradle and add this:
dependencies {
implementation files('libs/your jar file.jar')
}
Step 1: Download any JAR file for your Project.
Step 2: Copy .jar file and past in libs folder.
Step 3: Click on File > Project Structure >Select app > Dependencies
Step 4:
Step 5:
Step 6: After click Ok button then we can see the Dependencies add like this way:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With