huberflores / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Android API 17 (4.2) Gson.fromJson throws java.lang.StackOverflowError #496

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Setup an AVD with the 4.2 Android OS (API 17).  I used a Nexus 7, as the 
user crash reports for our app all came from Nexus 7 devices.
2.  Attempt to parse our login json package using Gson 2.2.
3.  StackOverflowError is thrown.

What is the expected output? What do you see instead?
The expected output is the parsed representation of the login package json.

What version of the product are you using? On what operating system?
Android 4.2 (API 17), Gson 2.2.2 lib

Please provide any additional information below.
Our json doesn't contain any complex types, just Boolean, String, BigDecimal, 
Date, and ArrayList<T> that hold collections of nested types. I have verified 
that there are no circular references in the result class.  The gson parser 
works perfectly fine in all Android OS versions from 2.2 (our minimum supported 
version) through 4.1, but in 4.2 we are experiencing this errro.

Original issue reported on code.google.com by androidd...@gmail.com on 18 Jan 2013 at 8:13

Attachments:

GoogleCodeExporter commented 9 years ago
"stack overflow on call to Lcom/google/gson/internal/$Gson$Types;.resolve:LLLL" 
on Nexus 4 running 4.2.1.

Exactly as reported, above. Shipping code runs fine on 2.2 through 4.1.2. Stack 
overflows on 4.2.x.

Original comment by d...@aylanetworks.com on 19 Jan 2013 at 11:22

GoogleCodeExporter commented 9 years ago
Same defect here with Nexus 7 running android 4.2.1
Can someone please provide a solution to that? Of course if i'll find a 
solution i'll post it here suddenly :)

Luca

Original comment by luca.dim...@gmail.com on 21 Jan 2013 at 9:09

GoogleCodeExporter commented 9 years ago
I have the exact same issue. I solved it (for now) by using GSON 1.7.1 but it 
is a lot slower...

Original comment by ferry.sp...@gmail.com on 21 Jan 2013 at 9:13

GoogleCodeExporter commented 9 years ago
I have confirmed that rolling back to the 1.7.1 gson release resolves the 
issue.  Here's hoping that someone on the gson team can provide a better 
resolution.  Hopefully this isn't the only course of action for us.  1.7.1 is 
quite a bit slower.

Original comment by androidd...@gmail.com on 21 Jan 2013 at 7:24

GoogleCodeExporter commented 9 years ago
I have the same issue. Occurs when a class extends another.

Original comment by juli...@gmail.com on 22 Jan 2013 at 1:42

GoogleCodeExporter commented 9 years ago
I get same error :(. Can anyone help?

Original comment by gawronsk...@gmail.com on 22 Jan 2013 at 5:11

GoogleCodeExporter commented 9 years ago
Same issue here, app works fine with Android API 16 (4.1.2), on on nexus 
devices gives FC.

For now I also went back to Gson v1.7.1 to make it works again..

Original comment by rkat...@gmail.com on 28 Jan 2013 at 9:17

GoogleCodeExporter commented 9 years ago
Are you serializing a WeakReference or SoftReference?

Original comment by limpbizkit on 4 Feb 2013 at 4:03

GoogleCodeExporter commented 9 years ago
No, my class structure doesn't contain any SoftReference or WeakReference 
declarations, just a basic map of String, BigDecimal, int, and ArrayList<T>.

Original comment by peytonmc...@gmail.com on 4 Feb 2013 at 5:27

GoogleCodeExporter commented 9 years ago
me too getting same error...plz help anyone

Original comment by jadhav.s...@gmail.com on 31 Jul 2013 at 10:56

GoogleCodeExporter commented 9 years ago
Same issue here. App works fine in normal debug mode(when you run your app from 
Android SDK to your emulator or phone). But when it's exported and built for 
release. It doesn't work.

Original comment by nehalniy...@gmail.com on 27 Jan 2015 at 9:50