App crash due to `java.lang.IncompatibleClassChangeError` in gson converter
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 12/100
Rechercherichtung
The crash trace runs through PresenceChannelImpl.java, in extractPresenceDataFrom (around line 186) and handleSubscriptionSuccessfulMessage, where Gson.fromJson parses presence data. The root cause is a gson version or classpath conflict on Android, so start by checking which gson version the library bundles and how the presence payload is deserialized. The issue asks a question rather than specifying a change, so 'done' is not defined; a newcomer would need a maintainer decision on the expected fix and a way to reproduce on a Samsung device or emulator.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Java
- Sterne
- 315
- Forks
- 140
- Ø Merge
- 10 T. 14 Std.
- Gemergte PRs (30 T.)
- 5
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus pusher/pusher-websocket-java
-
java.lang.NoClassDefFoundError: com.pusher.client.Pusher$$ExternalSyntheticLambda0 on Android API 21-22 anywayEvtl. vergeben @Keith-wright hat das vor 9 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 22/100
pusher/pusher-websocket-java#366 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
pusher/pusher-websocket-java#340 · 3 Kommentare · 7 Reaktionen ·
-
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 8/100
pusher/pusher-websocket-java#311 · 4 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 12/100
pusher/pusher-websocket-java#308 · 2 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 18/100
pusher/pusher-websocket-java#303 · 4 Kommentare ·
Alle Issues in pusher/pusher-websocket-java
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
quarkusio/quarkus-agent-mcp#302 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
build
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
MetricsHub/metricshub-community#1472 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
IdentityArrayObjectSet iterator remove may throw ArrayIndexOutOfBoundsExceptionEvtl. vergeben @jiteshkhatri11 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
javapathfinder/jpf-core#660 · 1 Kommentar ·