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