discomarathon / google-gson

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

gson library on Android throws java.lang.TypeNotPresentException #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

GSON version:  trunk   (7 January 2009)

Android platform:   Android 1.0 R2 SDK

I can't get GSON to work properly on Android's Dalvik VM.   The Android 
runtime is throwing java.lang.TypeNotPresentException.

I reproduced this bug with the Android SDK emulator and also on the Android
G1 Developer Phone.

Here is the stack trace:

E/jpoco.android.ContactsActivity(  251): Type jpoco.client.Contact not present
E/jpoco.android.ContactsActivity(  251):
java.lang.TypeNotPresentException: Type jpoco.client.Contact not
present
E/jpoco.android.ContactsActivity(  251):        at
org.apache.harmony.luni.lang.reflect.ImplForType.getRawType(ImplForType.java:63)
E/jpoco.android.ContactsActivity(  251):        at
org.apache.harmony.luni.lang.reflect.ImplForType.getResolvedType(ImplForType.jav
a:72)
E/jpoco.android.ContactsActivity(  251):        at
org.apache.harmony.luni.lang.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.ja
va:68)
E/jpoco.android.ContactsActivity(  251):        at
org.apache.harmony.luni.lang.reflect.ImplForType.getActualTypeArguments(ImplForT
ype.java:40)
E/jpoco.android.ContactsActivity(  251):        at
com.google.gson.TypeInfoFactory.getActualType(TypeInfoFactory.java:65)
E/jpoco.android.ContactsActivity(  251):        at
com.google.gson.TypeInfoFactory.getTypeInfoForField(TypeInfoFactory.java:54)
E/jpoco.android.ContactsActivity(  251):        at
com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:136)
E/jpoco.android.ContactsActivity(  251):        at
com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:122)
E/jpoco.android.ContactsActivity(  251):        at
com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializa
tionContextDefault.java:73)
E/jpoco.android.ContactsActivity(  251):        at
com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializatio
nContextDefault.java:49)
E/jpoco.android.ContactsActivity(  251):        at
com.google.gson.Gson.fromJson(Gson.java:381)
E/jpoco.android.ContactsActivity(  251):        at
com.google.gson.Gson.fromJson(Gson.java:329)
E/jpoco.android.ContactsActivity(  251):        at
com.google.gson.Gson.fromJson(Gson.java:305)
E/jpoco.android.ContactsActivity(  251):        at
jpoco.io.Deserializer.deserialize(Deserializer.java:63)
E/jpoco.android.ContactsActivity(  251):        at
jpoco.client.Client.fromString(Client.java:152)

Original issue reported on code.google.com by sean%sea...@gtempaccount.com on 7 Jan 2009 at 12:13

GoogleCodeExporter commented 9 years ago

This appears to be a bug in Android's implementation of
java.lang.reflect.ParameterizedType

I've opened an issue in the Android tracker:

http://code.google.com/p/android/issues/detail?id=1760

Original comment by sean%sea...@gtempaccount.com on 9 Jan 2009 at 9:37

GoogleCodeExporter commented 9 years ago
I installed the Android SDK 1.5 Preview last night.   Using the emulator, I can
confirm that this bug is resolved.

I'll retest when Android SDK 1.5 Final becomes available.

Original comment by sean%sea...@gtempaccount.com on 14 Apr 2009 at 4:16

GoogleCodeExporter commented 9 years ago
Thanks for testing this on Android SDK 1.5. We are glad that the issues have 
been 
resolved but if you find anything that is broken, please reopen the bug and we 
would 
be happy to fix it then.

Original comment by inder123 on 15 Apr 2009 at 9:20