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

Time:09-21

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

CodePudding user response:

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.

  • Related