Gson错误JellyBean

时间:2013-05-28 15:10:01

标签: android eclipse gson android-4.2-jelly-bean

我有一个Android应用程序,它在引用的库中使用Gson jar。我目前正在使用2.2.4版,我有2部手机可以测试它。

在三星Galaxy S Advance 2.3.6上完全可以在LG Nexus 4上完美运行4.2.2我收到了错误

The JAR gson-2.4.4 has no source attachment.

并在日志文件中

java.Lang.StackoverflowError

当然我正确导入了所需的库,否则它将不适用于Android 2.3.6。

你有什么建议吗?

由于

这是Stack:

05-28 14:58:50.540: E/AndroidRuntime(1038): FATAL EXCEPTION: Thread-92
05-28 14:58:50.540: E/AndroidRuntime(1038): java.lang.StackOverflowError
05-28 14:58:50.540: E/AndroidRuntime(1038):     at               com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:355)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:117)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.Gson.getAdapter(Gson.java:356)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.Gson.getAdapter(Gson.java:356)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.Gson.getAdapter(Gson.java:356)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.Gson.getAdapter(Gson.java:356)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
05-28 14:58:50.540: E/AndroidRuntime(1038):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)

1 个答案:

答案 0 :(得分:2)

这听起来像是与较新Android版本中所做更改相关的错误。如果没有看到你正在尝试序列化的类,很难确定问题所在。这个thread讨论了您遇到的问题,可能会指出您正确的方向。如果您无法找到问题,那么听起来将Gson恢复为1.7.1就可以了。