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

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

错误:

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.
GsonGsonTypes.resolve(
GsonGsonTypes.java:331)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.
GsonGsonTypes.resolve(
GsonGsonTypes.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版本,我换了还是报错。

本文转自博客园农民伯伯的博客,原文链接:,如需转载请自行联系原博主。

你可能感兴趣的文章
JQuery:deferred对象的方法
查看>>
eyoucms问答 百度权重是什么
查看>>
win10中遇到qq视频时摄像头打不开没反应的解决方法
查看>>
介绍自己的一个Android插桩热修复框架项目QuickPatch
查看>>
关于textarea的ie9的maxlength不起作用的问题,请参考如下URL解决。
查看>>
Solr Facet 查询
查看>>
C++类的继承一
查看>>
数据库分库分表(sharding)系列(五) 一种支持自由规划无须数据迁移和修改路由代码的Sharding扩容方案...
查看>>
巧用VMware Workstation的clone来制作虚拟机模板
查看>>
Spring-Mybatis MapperScannerConfigurer 取不到PropertyPlaceholderConfigurer里的值
查看>>
HP DL380G4服务器前面板指示灯的含义
查看>>
数据结构_树结构
查看>>
常用URL地址
查看>>
每天一个linux命令(19):find 命令概览
查看>>
MySQL kill操作
查看>>
windows下看端口占用
查看>>
Decommissioning a Domain Controller 降域控
查看>>
Character中的奇葩
查看>>
c++书籍推荐
查看>>
轻松监听Azure service health 状态
查看>>