Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

App crash due to `java.lang.IncompatibleClassChangeError` in gson converter

Aperta
#206 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
12/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
android, java
Ambito
mobile

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
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

Lingua principale
Java
Stelle
315
Fork
140
Merge medio
11g 5h
PR unite (30g)
4

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pusher/pusher-websocket-java

Tutte le issue di pusher/pusher-websocket-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.