zoukankan      html  css  js  c++  java
  • 【Gson】2.2.4 StackOverflowError 异常


    正文

    错误:

    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版本,我换了还是报错。

  • 相关阅读:
    学习进度笔记01
    《一级架构师实践指南》阅读笔记
    需求概述开发进度14
    需求概述开发进度13
    需求概述开发进度12
    需求概述开发进度11
    需求概述开发进度10
    爬虫的requests库和BeautifulSoup4的学习
    模拟体育竞技分析
    python文件格式转换
  • 原文地址:https://www.cnblogs.com/over140/p/3659221.html
Copyright © 2011-2022 走看看