Jackie
Jackie

Reputation: 84

Add external library and jar in Android Studio

Anyone can tell how to add external library and jar file in Android Studio, I know in Eclipse you can Right click -> Property -> Java Build Path, but what to do in Android Studio ?

Upvotes: 0

Views: 138

Answers (1)

Kai
Kai

Reputation: 926

For adding external library or dependency, you can either edit gradle file for app manually, or you can do it by Project Structure.

  • Edit Gradle File of app

Open gradle file of app, you can add/edit in the dependencies tag,

enter image description here

the first line compile fileTree(dir: 'libs', include: ['*.jar']) indicates that it will include the jar files in this project;

  • in Project Structure

File -> Project Structure, and in the pop-up window, click app in the left list, then click dependencies, in the top-right corner, click + to add new dependency.

enter image description here

Upvotes: 1

Related Questions