Crash on app start caused by empty resources

Offen
#645 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

@bradh arbeitet bereits daran.

Seit 01.11.2026.

  • #646 von @bradh — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
15/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
android, kotlin
Bereich
mobile

Rechercherichtung

The crash comes from zero-byte PNGs in app/src/main/res/drawable-xhdpi, such as img_keyart_multimodal.png, which the logcat trace shows failing in imageResource. Pull request 646 is already open against this issue, so review it before starting. Done means the app starts on the Samsung tablet and the empty drawables are either restored or no longer referenced.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

The application fails to start on a Samsung SM-X520 tablet.

The backtrace suggests failing to load the img_keyart_multimodal.png resource. See below.

That is likely because that resource (and several others) are empty.

~/camera-samples/app/src/main/res/drawable-xhdpi$ ls -la
total 5024
drwxrwxr-x  2 bradh bradh    4096 Nov  1 17:35 .
drwxrwxr-x 16 bradh bradh    4096 Nov  1 17:35 ..
-rw-rw-r--  1 bradh bradh 5134398 Nov  1 17:35 img_bg_landing.png
-rw-rw-r--  1 bradh bradh       0 Nov  1 17:35 img_keyart_chatbot.png
-rw-rw-r--  1 bradh bradh       0 Nov  1 17:35 img_keyart_imagen.png
-rw-rw-r--  1 bradh bradh       0 Nov  1 17:35 img_keyart_img_desc.png
-rw-rw-r--  1 bradh bradh       0 Nov  1 17:35 img_keyart_magic_selfie.png
-rw-rw-r--  1 bradh bradh       0 Nov  1 17:35 img_keyart_metadata.png
-rw-rw-r--  1 bradh bradh       0 Nov  1 17:35 img_keyart_multimodal.png
-rw-rw-r--  1 bradh bradh       0 Nov  1 17:35 img_keyart_summary.png
-rw-rw-r--  1 bradh bradh       0 Nov  1 17:35 img_keyart_text.png
-rw-rw-r--  1 bradh bradh       0 Nov  1 17:35 img_keyart_todo.png
-rw-rw-r--  1 bradh bradh       0 Nov  1 17:35 img_keyart_video_summary.png

From logcat:

026-11-01 20:19:28.237 19374-19374 ComposeInternal         com.android.camera.catalog           E  Error was captured in composition.
                                                                                                    androidx.compose.ui.res.ResourceResolutionException: Error attempting to load resource: res/drawable-xhdpi-v4/img_keyart_multimodal.png
                                                                                                    	at androidx.compose.ui.res.PainterResources_androidKt.loadImageBitmapResource(PainterResources.android.kt:112)
  ...
                                                                                                    Caused by: java.lang.NullPointerException: null cannot be cast to non-null type android.graphics.drawable.BitmapDrawable
                                                                                                    	at androidx.compose.ui.res.ImageResources_androidKt.imageResource(ImageResources.android.kt:39)
...
                                                                                                    Caused by: java.lang.NullPointerException: null cannot be cast to non-null type android.graphics.drawable.BitmapDrawable
                                                                                                    	at androidx.compose.ui.res.ImageResources_androidKt.imageResource(ImageResources.android.kt:39)
...
``
Vorherrschende Sprache
Kotlin
Sterne
5.5k
Forks
2.4k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus android/camera-samples

Alle Issues in android/camera-samples

Ähnliche Issues

Weitere Issues zu Kotlin

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.