Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to fix crash issue on a recycler view due to JsonSyntaxException?

How to fix crash issue on a recycler view due to JsonSyntaxException?

com.google.gson.JsonSyntaxException: java.lang.NumberFormatException:Expected an int but was 0.5 at line 1 column 39043 path $.items[10].weight

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Solution:

Step-1: Please try to crosscheck your json with your model class

Step-2: If any data type mismatch found, fix it.

Say for an example, if you define your ‘weight’ as an ‘Int’ on your model class and your json data type is ‘double’ then update your model class accordingly.

Step-3: Rebuild your project and run after cleanup.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading