No-args constructor for class X does not exist. Register an InstanceCreator with Gson for this type to fix this problem.

Gson解析JSON字符串时出现了下面的错误:

No-args constructor for class X does not exist. Register an InstanceCreator with Gson for this type to fix this problem.

解决的办法是把对应的Class改成静态类。

 

posted @ 2016-11-11 10:06  MSTK  阅读(2705)  评论(0编辑  收藏  举报