博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【Gson】2.2.4 StackOverflowError 异常
阅读量:5981 次
发布时间:2019-06-20

本文共 6595 字,大约阅读时间需要 21 分钟。

正文

错误:

08-09 09:56:51.904: E/AndroidRuntime(16384): java.lang.StackOverflowError
08-09 09:56:51.904: E/AndroidRuntime(16384):     at java.lang.Class.isArray(Class.java:1044)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:331)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:355)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:117)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.Gson.getAdapter(Gson.java:353)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)

 

原因:

 我这边的情况是序列化对象嵌套了"其他对象",而赋值的时候又是这个"其他对象"的子类,导致了这个异常。网上游遇到同样错误的建议换到1.7.1版本,我换了还是报错。

 

 

转载于:https://www.cnblogs.com/over140/p/3659221.html

你可能感兴趣的文章
老司机带你深入浅出 Collection
查看>>
查询系统-vba
查看>>
[译]Spring Session 与 Spring Security
查看>>
python学习笔记(05)
查看>>
JAVA BIO 服务器与客户端实现示例
查看>>
《Cisco IPv6网络实现技术(修订版)》一2.6 配置练习:使用Cisco路由器配置一个IPv6网络...
查看>>
《可穿戴创意设计:技术与时尚的融合》一一第2章 与可穿戴设备有关的故事...
查看>>
ruby动态new对象
查看>>
Linux中grep命令的12个实践例子
查看>>
使用Docker Compose部署基于Sentinel的高可用Redis集群
查看>>
Mybatis 3学习笔记(一)
查看>>
Guice系列之用户指南(十)
查看>>
树与森林的存储、遍历和树与森林的转换
查看>>
Android自定义属性
查看>>
Visual C#之核心语言
查看>>
代码重构(五):继承关系重构规则
查看>>
Windows App开发之集合控件与数据绑定
查看>>
中大型网站技术架构演变过程
查看>>
ARTS训练第三周
查看>>
vue中v-for循环如何将变量带入class的属性名中
查看>>