android/sunflower

App crashes.

hhyeok1026 opened this issue · 2 comments

How to reproduce:
Add a plant → Close the app. (Clean up the app by pressing the recent button) → Run the app again (crash occurs)

  • Both the emulator and the real device crashed.

  • But, after deleting the cache data of the app, it works again when relaunched.

error stack
2023-05-18 12:07:50.140 13418-13418 AndroidRuntime com.google.samples.apps.sunflower E FATAL EXCEPTION: main
Process: com.google.samples.apps.sunflower, PID: 13418
java.lang.IllegalStateException: removeReporter() called when all reporters have already been removed.
at androidx.activity.FullyDrawnReporter.removeReporter(FullyDrawnReporter.kt:107)
at androidx.activity.compose.ReportDrawnComposition.removeReporter(ReportDrawn.kt:74)
at androidx.activity.compose.ReportDrawnKt$ReportDrawnWhen$1$invoke$$inlined$onDispose$2.dispose(Effects.kt:484)
at androidx.compose.runtime.DisposableEffectImpl.onForgotten(Effects.kt:85)
at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1094)
at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:820)
at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:842)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:592)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:510)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1229)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
at android.view.Choreographer.doCallbacks(Choreographer.java:899)
at android.view.Choreographer.doFrame(Choreographer.java:827)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7898)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@92feea, androidx.compose.ui.platform.MotionDurationScaleImpl@b3e05db, StandaloneCoroutine{Cancelling}@1936878, AndroidUiDispatcher@a683b51]

This appears to be an issue with calling ReportDrawn in succession. Haven't pinned down a fix yet. It may also be a bug in the ReportDrawn API.

Yep. This is an API bug which will be fixed in an upcoming release https://issuetracker.google.com/issues/260506820