App crash due to `java.lang.IncompatibleClassChangeError` in gson converter
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Java
- スター
- 315
- フォーク
- 140
- 平均マージ
- 10日 14時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pusher/pusher-websocket-java のほかの issue
-
java.lang.NoClassDefFoundError: com.pusher.client.Pusher$$ExternalSyntheticLambda0 on Android API 21-22 anyway対応中かも @Keith-wright が 9 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
pusher/pusher-websocket-java#366 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
pusher/pusher-websocket-java#340 · コメント 3 件 · リアクション 7 件 ·
-
難易度 4/5 1〜2日 初心者へのやさしさ 8/100
pusher/pusher-websocket-java#311 · コメント 4 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 12/100
pusher/pusher-websocket-java#308 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
pusher/pusher-websocket-java#303 · コメント 4 件 ·
pusher/pusher-websocket-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
build
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
MetricsHub/metricshub-community#1472 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
IdentityArrayObjectSet iterator remove may throw ArrayIndexOutOfBoundsException対応中かも @jiteshkhatri11 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
javapathfinder/jpf-core#660 · コメント 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信