Android performs Gson.tojson (object) Report Java.lang.StackOverflowError exception

Source: Internet
Author: User

The following code is executed after the Java.lang.StackOverflowError error is reported:

Musicsavedinfo musicsavedinfo=new Musicsavedinfo (Currentstarttime,openorcloseflag,currentdayflags, Currentselectmusictitle,currentselectmusicpath, "1"); String Jsondata=gson.tojson (Musicsavedinfo);
My Phone 4.1 system, the implementation of normal will not error, to 4.4 of the system to report the following error

06-25 20:31:50.092:e/androidruntime (25122): java.lang.stackoverflowerror06-25 20:31:50.092:e/androidruntime (25122 ): at com.google.gson.internal. $Gson $types.resolve ($Gson $types.java:380) 06-25 20:31:50.092:e/androidruntime (25122 ): at com.google.gson.internal. $Gson $types.resolve ($Gson $types.java:375) 06-25 20:31:50.092:e/androidruntime (25122 ): at com.google.gson.internal. $Gson $types.resolve ($Gson $types.java:380) 06-25 20:31:50.092:e/androidruntime (25122 ): at com.google.gson.internal. $Gson $types.resolve ($Gson $types.java:375) 06-25 20:31:50.092:e/androidruntime (25122 ): at com.google.gson.internal. $Gson $types.resolve ($Gson $types.java:380) 06-25 20:31:50.092:e/androidruntime (25122 ): at com.google.gson.internal. $Gson $types.resolve ($Gson $types.java:375)
Finally the Gson-2.1.jar replaced with Gson-1.7.1.jar, that is, 4.4 system can also be carried out, although for a moment do not know why, but is solved.

Gson-1.7.1.jar Bag: Gson-1.7.1.jar

Android performs Gson.tojson (object) Report Java.lang.StackOverflowError exception

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.