user4725754
user4725754

Reputation:

Using external JAR files in Android Studio

I have an android project and use Android Studio as IDE. How can I add external jar's to the build path or how can I use them? My project is libGDX based, so I haven't libs folder in root.

Upvotes: 2

Views: 96

Answers (1)

siddhartha shankar
siddhartha shankar

Reputation: 1460

The jar I was importing had been compiled/exported with Java 7 in mind. Once I enabled compliance with Java 6 it worked fine.

To sum it up, when adding an external jar file in Android Studio:

  1. Copy jar to root/project/libs folder; 2.Right-click and add as library; 3.Add the jar to root/project/build.gradle (something like compile files('libs/test-jar-to-import.jar')); 4.Make sure the imported jar complies with Java 6 (7 will not do, for now).

Upvotes: 1

Related Questions