How to add JAR as library in android studio

Following is procedure to add JAR as library in Android Studio
Add JAR library to libs folder and resync in (for OS windows)

1.Put the Gson jar (in my case, gson-2.2.4.jar) into the libs folder
2.Right click it and hit 'Add as library'
3.Ensure that compile files('libs/gson-2.2.4.jar') is in your build.gradle file

Do a clean build (you can probably do this fine in Android Studio, but to make sure I navigated in a terminal to the root folder of my app and typed gradlew clean.

Sign In or Register to comment.