×

fastjson default constructor not found fastjson Attempt to get length of null array

Android使用fastjson报错Attempt to get length of null array

mtsym mtsym 发表于2020-04-24 18:49:01 浏览8826 评论0

抢沙发发表评论

一个Android项目加了一个kotlin的类,在parse的时候,一开始报错

com.alibaba.fastjson.JSONException: default constructor not found

使用注解增加了一个默认函数

@JSONCreator constructor() : this("", "") { }

之后还是报错

fastjson  JSONException: Attempt to get length of null array

这个是因为我没有是用android版本的fastjson库导致的,直接引入库就好了

群贤毕至

访客