Gson 2.2.2 causing a stackoverflow on 4.2.1 only

僤鯓⒐⒋嵵緔 提交于 2019-11-30 18:40:41

So it turns out this is a bug as Erik Nedwidek pointed out. I took the easy route and downgraded gson from 2.2.2 to 1.7.1, everything works a treat now !

Check out this bug report. http://code.google.com/p/google-gson/issues/detail?id=440

Comment #12:

I believe it was in API 17 that the internals of WeakReference and SoftReference changed to be self-referent, which would trigger this. Are you using Gson to serialize a WeakReference or SoftReference? If you are, you should write your own TypeAdapter for those types.

Something in your code is causing a circular reference and since it works up until 4.2.1 (API 17), it is most likely one of the Java classes. It still could be your code, but I'm highly doubtful.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!