Open bwixted opened 6 years ago
Hi! I'll see now
Thank you!
@bwixted did you ever find a workaround, as I have a very similar if not the same error. Thanks!
com.google.gson.JsonSyntaxException: XML parsing exception at com.stanfy.gsonxml.XmlReader.peek(XmlReader.java:302) at com.stanfy.gsonxml.XmlReader.expect(XmlReader.java:141) at com.stanfy.gsonxml.XmlReader.beginObject(XmlReader.java:149) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:165) at com.google.gson.Gson.fromJson(Gson.java:795) at com.stanfy.gsonxml.GsonXml.fromXml(GsonXml.java:92) at com.stanfy.gsonxml.GsonXml.fromXml(GsonXml.java:66) at com.stanfy.gsonxml.GsonXml.fromXml(GsonXml.java:52) at com.stanfy.gsonxml.GsonXml.fromXml(GsonXml.java:42) at com.homehub.dragan.myhomehub.UPnPDevice.xmlParse(UPnPDevice.java:104) at com.homehub.dragan.myhomehub.UPnPDevice.update(UPnPDevice.java:54) at com.homehub.dragan.myhomehub.DeviceDiscoveryUPnP$3.onResponse(DeviceDiscoveryUPnP.java:134) at com.homehub.dragan.myhomehub.DeviceDiscoveryUPnP$3.onResponse(DeviceDiscoveryUPnP.java:131)
@DraganKov - no I don't. This does not happen very often to my app fortunately.
Hi,
It is just enough to enclose:
xmlParse(xml);
in UPnPDevice.java in a try catch:
try{ xmlParse(xml);} catch (Exception e) {}
Thanks for creating this library. Works very well. I sometimes get a crash from stanfy.gsonxml. Would it be possible to ignore these or some way I can prevent it crashing my app? Thank you! Bill
com.google.gson.JsonSyntaxException: at com.stanfy.gsonxml.XmlReader.peek (XmlReader.java:302) at com.stanfy.gsonxml.XmlReader.expect (XmlReader.java:141) at com.stanfy.gsonxml.XmlReader.beginObject (XmlReader.java:149) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read (ReflectiveTypeAdapterFactory.java:213) at com.google.gson.Gson.fromJson (Gson.java:887) at com.stanfy.gsonxml.GsonXml.fromXml (GsonXml.java:92) at com.stanfy.gsonxml.GsonXml.fromXml (GsonXml.java:66) at com.stanfy.gsonxml.GsonXml.fromXml (GsonXml.java:52) at com.stanfy.gsonxml.GsonXml.fromXml (GsonXml.java:42) at com._8rine.upnpdiscovery.UPnPDevice.xmlParse (UPnPDevice.java:104) at com._8rine.upnpdiscovery.UPnPDevice.update (UPnPDevice.java:54) at com._8rine.upnpdiscovery.UPnPDiscovery$3.onResponse (UPnPDiscovery.java:134) at com._8rine.upnpdiscovery.UPnPDiscovery$3.onResponse (UPnPDiscovery.java:131) at com.android.volley.toolbox.StringRequest.deliverResponse (StringRequest.java:82) at com.android.volley.toolbox.StringRequest.deliverResponse (StringRequest.java:29) at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run (ExecutorDelivery.java:102) at android.os.Handler.handleCallback (Handler.java:751) at android.os.Handler.dispatchMessage (Handler.java:95) at android.os.Looper.loop (Looper.java:159) at android.app.ActivityThread.main (ActivityThread.java:6130) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:755)