Friday, 11 May 2012

Android(Java) - gson\json deserialization error

Android Blog With example

Hello Friends,
     I found a strange issue in android application , My application is running 
     Fine but in few of the device(like:HTC Explorer, HTC Desire.....) its gives  
     parsing error.....
           JsonParseException: The JsonDeserializer  
           DefaultTypeAdapters$CollectionTypeAdapter@4e76fba0 failed to
            deserialize ...
   After doing a lot of investigation  , Here are the steps which I follow to fixed 
   this issue:
    1) Download jarjar (
    2) Put jarjar-1.3.jar and gson-2.1.jar in the same folder
    3) Create a new text file in this folder (rules.txt)
    4) Write the following line in the textfile:     
   5) From the command line, go in to the folder where you placed 
        jarjar-1.3.jar and gson-2.1.jar and run the following 
      "java -jar jarjar.jar process rules.txt gson-2.1.jar myjson-2.1.jar"  
  6) Replace the gson library in your project with myjson and
      update the imports.
  Hope this will helps you!
  cheers! :)
  Happy coding....... 

Mukesh Yadav

Hi Guys I am from Delhi working as Web/Mobile Application Developer(Android Developer), also have knowledge of Roboelctric and Mockito ,android test driven development... Blogging has been my passion and I think blogging is one of the powerful medium to share knowledge and ideas....


  1. great it's working fine !
    i looking for that code thanx to you.



Copyright @ 2013 Android Developer Blog.

Blog Widget by LinkWithin