在转换过程中会抛出“No-args constructor for class com.pwm.gson.A$B does not exist”异常。解析方法把内部类改为静态内部类,或者按异常信息“Register
an InstanceCreator with Gson for this type to fix this problem”所示,用Gson为其提供一个内部实例创建器,但GSON强烈不建议使用此方法。
Register an InstanceCreator with Gson for this type to fix this problem.
最新推荐文章于 2024-04-11 15:59:00 发布
本文介绍了解决在使用GSON进行转换时出现“No-args constructor for class com.pwm.gson.A$B does not exist”异常的方法。一种解决方案是将内部类更改为静态内部类,另一种则是为GSON提供一个实例创建器。
1万+





