How to add Gson library to Android Studio project

Default featured post

Google Android Studio from my point of view is the most suitable IDE for native Android programming. It is simply works out of the box. However, during working with this IDE, I have faced the shortage of documentation. Unfortunately, majorities of tutorials have been written for Eclipse IDE and since Android Studio in comparison is considered as new, the lack of documentation is quite obvious especially for beginners like me. For instance, I was seeking on the net about adding Gson (or any other) library to Android Studio and didn’t find a suitable document for that. Finally, I have randomly found it by chance.

Adding libraries in Android Studio is fairly easy in overall. In this example, I explain about importing Gson lib to Android project. In order to add library click on File menu from Android Studio and select Project Structure like the following picture,

Android

Then from the pop up menu select Dependencies tab like this

Dependencies

And then click on “+” and choose you Gson library like below,

Lib

After that click on OK and close the tab. Now you can start using Gson library in your project.

2 thoughts on “How to add Gson library to Android Studio project

  1. Hey Kasra,

    I have been trying to do the same but not able to use Gson in my project. It does not even import gson into my project.
    Min SDK version in my project is 15 and target SDK = 23

Comments are closed.