Gson 2.2.2 causing a stackoverflow on 4.2.1 only

前端 未结 2 720
孤街浪徒
孤街浪徒 2021-01-04 13:49

I am developing an app for android which downloads points of interest from a server using JSON strings. Everything was working fine but since I have started testing on 4.2.1

2条回答
  •  北海茫月
    2021-01-04 14:36

    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.

提交回复
热议问题