Open
Description
Issue:
We are receiving crashes on samsung devices with OS 4, 5 & 8. I'm using pusher-java-client:1.8.2
and gson:2.8.4
in my code.
Crash Report
Fatal Exception: java.lang.IncompatibleClassChangeError: Couldn’t find com.google.gson.annotations.SerializedName.value
at libcore.reflect.AnnotationAccess.toAnnotationInstance + 659(AnnotationAccess.java:659)
at libcore.reflect.AnnotationAccess.toAnnotationInstance + 641(AnnotationAccess.java:641)
at libcore.reflect.AnnotationAccess.getDeclaredAnnotation + 170(AnnotationAccess.java:170)
at java.lang.reflect.Field.getAnnotation + 242(Field.java:242)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getFieldNames + 1(ReflectiveTypeAdapterFactory.java:74)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields + 11(ReflectiveTypeAdapterFactory.java:161)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create + 4(ReflectiveTypeAdapterFactory.java:102)
at com.google.gson.Gson.getAdapter + 9(Gson.java:458)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField + 4(ReflectiveTypeAdapterFactory.java:117)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields + 15(ReflectiveTypeAdapterFactory.java:166)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create + 4(ReflectiveTypeAdapterFactory.java:102)
at com.google.gson.Gson.getAdapter + 9(Gson.java:458)
at com.google.gson.Gson.fromJson + 16(Gson.java:926)
at com.google.gson.Gson.fromJson + 10(Gson.java:892)
at com.google.gson.Gson.fromJson + 4(Gson.java:841)
at com.google.gson.Gson.fromJson + 1(Gson.java:813)
at com.pusher.client.channel.impl.PresenceChannelImpl.extractPresenceDataFrom + 2(PresenceChannelImpl.java:186)
at com.pusher.client.channel.impl.PresenceChannelImpl.handleSubscriptionSuccessfulMessage + 1(PresenceChannelImpl.java:124)
at com.pusher.client.channel.impl.PresenceChannelImpl.onMessage + 3(PresenceChannelImpl.java:57)
at com.pusher.client.channel.impl.ChannelManager.onMessage + 5(ChannelManager.java:107)
at com.pusher.client.connection.websocket.WebSocketConnection.handleEvent + 3(WebSocketConnection.java:177)
at com.pusher.client.connection.websocket.WebSocketConnection.access$600 + 1(WebSocketConnection.java:27)
at com.pusher.client.connection.websocket.WebSocketConnection$6.run + 3(WebSocketConnection.java:261)
at com.pusher.client.util.Factory$1.run + 2(Factory.java:109)
at java.util.concurrent.ThreadPoolExecutor.runWorker + 1112(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run + 587(ThreadPoolExecutor.java:587)
at java.lang.Thread.run + 818(Thread.java:818)
This issue seems to be related to gson converter used by pusher. It is also reported here but the users are experiencing it only on Samsung devices with OS version 5 while we are experiencing on other OSs as well. Is there any workaround to avoid this crash? Does reverting back to gson:2.2.2
will fix this as this is the version currently used by your library?
CC @pusher/mobile