MediaGalleryPreviewActivity crashes on Android 13: NPE Class.isInterface() in typed getParcelableExtra
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
調査の方向性
MediaGalleryPreviewActivity.ktを開き、レポートに記載されたIntentとBundleの型指定されたParcelable読み取りを調べます。APIレベルの処理をIntentCompat.getParcelableExtraおよびBundleCompat.getParcelableと比較し、API 33でのAndroidXの互換動作を確認します。報告されたクラッシュが発生せずにAndroid 13でプレビューが開き、保存状態の読み取りに互換性のあるgetterが使われれば、issueは完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
MediaGalleryPreviewActivity crashes on Android 13 (API 33) while reading its intent extras, with no app code in the stack:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Class.isInterface()' on a null object reference
at java.lang.Class.isAssignableFrom(Class.java:874)
at android.os.Parcel.readParcelableCreatorInternal(Parcel.java:4875)
at android.os.Parcel.readParcelableInternal(Parcel.java:4788)
at android.os.Parcel.readValue(Parcel.java:4554)
at android.os.Parcel.readValue(Parcel.java:4334)
at android.os.Parcel.-$$Nest$mreadValue(Unknown Source)
at android.os.Parcel$LazyValue.apply(Parcel.java:4432)
at android.os.Parcel$LazyValue.apply(Parcel.java:4391)
at android.os.BaseBundle.getValueAt(BaseBundle.java:394)
at android.os.BaseBundle.getValue(BaseBundle.java:374)
at android.os.BaseBundle.getValue(BaseBundle.java:357)
at android.os.BaseBundle.get(BaseBundle.java:696)
at android.os.Bundle.getParcelable(Bundle.java:947)
at android.content.Intent.getParcelableExtra(Intent.java:8930)
at io.getstream.chat.android.compose.ui.attachments.preview.MediaGalleryPreviewActivity.onCreate$lambda$13(MediaGalleryPreviewActivity.kt)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:122)
...
The private helper Intent.getParcelable<T>(key) in MediaGalleryPreviewActivity switches to the typed getParcelableExtra(key, T::class.java) from Build.VERSION_CODES.TIRAMISU. The typed Intent/Bundle getters have a known platform bug on API 33 that throws exactly this NPE inside Parcel.readParcelableCreatorInternal; it is fixed in API 34. That is why androidx.core.content.IntentCompat.getParcelableExtra / BundleCompat.getParcelable only use the typed API from UPSIDE_DOWN_CAKE and fall back to the untyped call on 33.
Suggested fix: replace the helper with IntentCompat.getParcelableExtra(intent, key, T::class.java) (or raise the version check to Build.VERSION_CODES.UPSIDE_DOWN_CAKE). The same pattern applies to the Bundle reads from savedInstanceState.
The file is identical in 7.13.0, 7.18.0 and develop, so the crash is still present in the latest release.
SDK version
stream-chat-android-compose7.13.0 (code unchanged up to 7.18.0 /develop)
To Reproduce
Not reproducible on demand: it is a platform race in the Android 13 typed Parcel API. Observed in production:
- Open a channel containing an image attachment
- Tap the image to open
MediaGalleryPreviewActivity - The activity crashes during the first composition
Expected behavior
The media gallery preview opens without crashing on Android 13.
Device:
- Vendor and model: Xiaomi Redmi Note 11 (2201117TY)
- Android version: 13 (TKQ1.221114.001)
Screenshots
N/A
- 主要言語
- Kotlin
- スター
- 1.7k
- フォーク
- 321
- 平均マージ
- 19時間 57分
- マージ済み PR(30日)
- 167
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
GetStream/stream-chat-android のほかの issue
-
feature request
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
GetStream/stream-chat-android#6556 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add Sort Order Support for Media and Files Attachments Lists in Channel Info再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンfeature request
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
GetStream/stream-chat-android#6359 ·
メンテナーはふだん 1 日以内に返信
-
feature request
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
GetStream/stream-chat-android#6243 ·
メンテナーはふだん 1 日以内に返信
-
Unable to wrap ChannelList height due to internal LazyColumn .fillMaxSize()再び着手できるかも @Ahmetkaragunlu が 19 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンcompose feature request
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
GetStream/stream-chat-android#5612 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
core feature request
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
GetStream/stream-chat-android#5279 ·
メンテナーはふだん 1 日以内に返信
GetStream/stream-chat-android の issue をすべて見る
似ている issue
-
unconfirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
thunderbird/thunderbird-android#11893 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
Droid-Deck/DroidDeck#2198 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
world-federation-of-advertisers/cross-media-measurement#4846 ·
メンテナーはふだん 1 日以内に返信
-
autoteam community connectors/destination/mssql connectors/source/hubspot team/use
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
airbytehq/airbyte#91201 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信