原 FastJson 版本 com.alibaba:fastjson:1.2.34
之后因为要发包,同事更新到了 com.alibaba:fastjson:1.2.69
结果在原数据 Bean 中 BigDecimal t_money 这个字段解析出错:
com.alibaba.fastjson.JSONException: Invalid BigInteger: 2403009:58:310817008.png281008.png
将数据改类型改为 String 就没问题,很奇怪,而且相应的数据在 IDE 中导包进行解析也是正常的,但在 Android 机下就不正常,后来把版本改回来就正常了。之后在阿里的 GitHub 上搜索,找到了 Android 专用的 FastJson 版本,导入后也显示正常,不亏是 BugJson ,好多坑。
https://github.com/alibaba/fastjson
https://github.com/alibaba/fastjson/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98
https://github.com/alibaba/fastjson/wiki/Android%E7%89%88%E6%9C%AC