android-jetpack-composewear-oscrashlytics

Crashlytics Logging Excaption Inside Compose


I am using Crashlytics with my WearOS app. Crashlytics dashboard has logged an exception outside of my code. Here is the stack trace:

Fatal Exception: java.lang.IllegalStateException: Dispatching rotary event while focus system is invalidated.
   at androidx.compose.ui.focus.FocusOwnerImpl.dispatchRotaryEvent(FocusOwnerImpl.kt:319)
   at androidx.compose.ui.platform.AndroidComposeView.handleRotaryEvent(AndroidComposeView.android.kt:1964)
   at androidx.compose.ui.platform.AndroidComposeView.dispatchGenericMotionEvent(AndroidComposeView.android.kt:1911)
   at android.view.ViewGroup.dispatchGenericFocusedEvent(ViewGroup.java:2578)
   at android.view.View.dispatchGenericMotionEvent(View.java:16372)
   at android.view.ViewGroup.dispatchGenericFocusedEvent(ViewGroup.java:2578)
   at android.view.View.dispatchGenericMotionEvent(View.java:16372)
   at android.view.ViewGroup.dispatchGenericFocusedEvent(ViewGroup.java:2578)
   at android.view.View.dispatchGenericMotionEvent(View.java:16372)
   at android.view.ViewGroup.dispatchGenericFocusedEvent(ViewGroup.java:2578)
   at android.view.View.dispatchGenericMotionEvent(View.java:16372)
   at com.android.internal.policy.DecorView.superDispatchGenericMotionEvent(DecorView.java:504)
   at com.android.internal.policy.PhoneWindow.superDispatchGenericMotionEvent(PhoneWindow.java:1962)
   at android.app.Activity.dispatchGenericMotionEvent(Activity.java:4550)
   at com.android.internal.policy.DecorView.dispatchGenericMotionEvent(DecorView.java:468)
   at android.view.ViewRootImpl$ViewPostImeInputStage.processGenericMotionEvent(ViewRootImpl.java:7660)
   at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7330)
   at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6723)
   at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6780)
   at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6746)
   at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6912)
   at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6754)
   at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6969)
   at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6727)
   at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6780)
   at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6746)
   at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6754)
   at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6727)
   at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6780)
   at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6746)
   at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6945)
   at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:7170)
   at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:4815)
   at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:4219)
   at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:4210)
   at android.view.inputmethod.InputMethodManager.-$$Nest$mfinishedInputEvent()
   at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:4792)
   at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:181)
   at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
   at android.os.MessageQueue.next(MessageQueue.java:349)
   at android.os.Looper.loopOnce(Looper.java:189)
   at android.os.Looper.loop(Looper.java:317)
   at android.app.ActivityThread.main(ActivityThread.java:8592)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
    

Should I be worried about this? Seems like a bug / issue inside Compose?


Solution

  • It's a bug in Compose starting with 1.7.0.

    Tracked here: https://issuetracker.google.com/issues/379289347

    Fixed in this commit: https://android-review.googlesource.com/c/platform/frameworks/support/+/3365297 (should be a release after 1.8.0-alpha06).