Crash on app start caused by empty resources
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 15/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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)
...
``
- Dominant language
- Kotlin
- Stars
- 5.5k
- Forks
- 2.4k
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from android/camera-samples
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
android/camera-samples#546 ·
-
camerax)Open
android/camera-samples#644 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
android/camera-samples#545 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
android/camera-samples#544 ·
-
Does CameraX plan to support USB Camera? When was the launch date? Someone raised Issues in 2019Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
android/camera-samples#543 · 2 comments · 1 reaction ·
All issues in android/camera-samples
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
MetrolistGroup/Metrolist#5426 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
🐛 Type:Bug 📥 State:Awaiting Assignment 🚨 Priority: P0 - Critical
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
micronizationlab/glafira-ai-hub#785 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sorsama/deepseek-harness-mobile#154 ·
Maintainers usually reply within 1 day
-
0. Needs triage enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day