gpt4 book ai didi

android - Gson 错误 JellyBean

转载 作者:行者123 更新时间:2023-11-29 21:42:04 31 4
gpt4 key购买 nike

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

在 Samsung 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 上运行。

你有什么建议吗?

谢谢

这是堆栈:

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)

最佳答案

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

关于android - Gson 错误 JellyBean,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16795492/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com