0

i need a help with using Gson library. I made a build path and imported it into my class, but when i initialize the Gson object i get an NoClassDefFoundError. I also tryed to download some other versions but didnt helped. Now using 2.2.4. Thanks in advance!

pavle
  • 909
  • 14
  • 38

3 Answers3

1

Try this

  1. Right click on project
  2. Properties
  3. Java Build Path
  4. Order And Export
  5. Check all dependencies
  6. Clean and Build
  7. Now Run your project

add Gson to project

einverne
  • 6,454
  • 6
  • 45
  • 91
Biraj Zalavadia
  • 28,348
  • 10
  • 61
  • 77
0

Here is a guide that could help you. Its explains how to setup and use GSON.

Use GSON to work with JSON in your Android apps

MungoRae
  • 1,912
  • 1
  • 16
  • 25
0

To add support of GSON on android studio, just add line below to app build.gradle file.

compile 'com.google.code.gson:gson:2.7'

By now 2.7 is last current available version according to: https://mvnrepository.com/artifact/com.google.code.gson/gson

Please check this repository to be sure you are using last available version.

Juan Pablo
  • 1,213
  • 10
  • 15