Skip to content

Crash on launch after battery shutdown / reboot (Android) #42

Description

@NONAMESAREAVAILABLE

TrinketOS crashes immediately on launch. The crash appears to be a Kotlin NoSuchElementException (random from an empty collection) inside SpriteView during startup rendering logic.

This started after my phone shut off due to low battery, then I charged it and turned it back on.

Steps To Reproduce

  1. Wait until the phone powers off due to low battery.
  2. Charge the phone and turn it back on.
  3. Open TrinketOS.
  4. App crashes immediately.

System:
Device: Nothing phone 1
Android version: 15
TrinketOS version: 3.11
Additional context
Logcat indicates the fatal exception:

com.smslv.trinketos launching com.smslv.trinketos/.MainActivity (userId 0)
java.util.NoSuchElementException: Collection is empty
at kotlin.collections.CollectionsKt___CollectionsKt.random(_Collections.kt:570)
at com.smslv.trinketos.terminals.views.SpriteView$sleeping$1.invokeSuspend(SpriteView.kt:240)
Fix / workaround: It stopped crashing after I force-stopped the app and cleared the app data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions