android / android/codelab-android-workmanager

Crash when starting the app on branch `start_kotlin` using xxhdpi device

Offen
#257 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Kotlin
Sterne
557
Forks
242
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I just started the app as proposed in codelab and this happened:
```
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.background, PID: 24751
java.lang.RuntimeException: Canvas: trying to draw too large(118054944bytes) bitmap.
at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:229)
at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:97)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
...
```
Device:
```
Moto G 5
API Level 27
```

As described [in this answer](https://stackoverflow.com/a/59794171/11111289):
> When an image that is only in drawable/folder is used on xxhdpi device, the potentially already big image is upscaled by a factor of 3, which can then in some cases cause the image's memory footprint to explode.

In the case of this project the error is happening due to the drawable `android_cupcake.png`

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne auf dem `start_kotlin`-Branch, indem du das `android_cupcake.png`-Drawable und seine Referenzen lokalisierst. Reproduziere den Start auf einem xxhdpi-Android-Gerät oder -Emulator und überprüfe anschließend, dass die App ohne den Absturz wegen eines zu großen Bitmaps startet und das Bild weiterhin enthält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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