Jetpack Compose: операции компоновки по согласованию действительны только в том случае, если значение isAttached верно на устройствах Android 6

#android #android-jetpack-compose

Вопрос:

Моя система отчетов о сбоях зафиксировала сбой, который происходит примерно на 4% устройств. Затронутые устройства либо производятся LG, Samsung или Huawei и работают под управлением Android 6.0.1. Я не могу воспроизвести проблему на своих тестовых устройствах под управлением API 23.

Исключение:

 Fatal Exception: java.lang.IllegalStateException: LayoutCoordinate operations are only valid when isAttached is true
       at androidx.compose.ui.node.LayoutNodeWrapper.getParentLayoutCoordinates(LayoutNodeWrapper.kt:105)
       at androidx.compose.ui.layout.LayoutCoordinatesKt.findRoot(LayoutCoordinates.kt:155)
       at androidx.compose.ui.layout.LayoutCoordinatesKt.boundsInWindow(LayoutCoordinates.kt:120)
       at androidx.compose.ui.semantics.SemanticsNode.getBoundsInWindow(SemanticsNode.kt:120)
       at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat_androidKt.getAllUncoveredSemanticsNodesToMap$findAllSemanticNodesRecursive(AndroidComposeViewAccessibilityDelegateCompat.android.kt:2082)
       at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat_androidKt.getAllUncoveredSemanticsNodesToMap$findAllSemanticNodesRecursive(AndroidComposeViewAccessibilityDelegateCompat.android.kt:2092)
       at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat_androidKt.getAllUncoveredSemanticsNodesToMap(AndroidComposeViewAccessibilityDelegateCompat.android.kt:2098)
       at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat_androidKt.getAllUncoveredSemanticsNodesToMap$default(AndroidComposeViewAccessibilityDelegateCompat.android.kt:2071)
       at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.getCurrentSemanticsNodes(AndroidComposeViewAccessibilityDelegateCompat.android.kt:176)
       at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.populateAccessibilityNodeInfoProperties(AndroidComposeViewAccessibilityDelegateCompat.android.kt:290)
       at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.createNodeInfo(AndroidComposeViewAccessibilityDelegateCompat.android.kt:247)
       at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.access$createNodeInfo(AndroidComposeViewAccessibilityDelegateCompat.android.kt:86)
       at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat$MyNodeProvider.createAccessibilityNodeInfo(AndroidComposeViewAccessibilityDelegateCompat.android.kt:1996)
       at android.view.View.createAccessibilityNodeInfoInternal(View.java:6040)
       at android.view.View$AccessibilityDelegate.createAccessibilityNodeInfo(View.java:22287)
       at android.view.View.createAccessibilityNodeInfo(View.java:6026)
       at android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:145)
       at android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:119)
       at android.view.View.onInitializeAccessibilityEventInternal(View.java:5980)
       at android.view.View$AccessibilityDelegate.onInitializeAccessibilityEvent(View.java:22199)
       at androidx.core.view.AccessibilityDelegateCompat.onInitializeAccessibilityEvent(AccessibilityDelegateCompat.java:257)
       at androidx.core.view.AccessibilityDelegateCompat$AccessibilityDelegateAdapter.onInitializeAccessibilityEvent(AccessibilityDelegateCompat.java:76)
       at android.view.View.onInitializeAccessibilityEvent(View.java:5966)
       at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:5833)
       at android.view.View$AccessibilityDelegate.sendAccessibilityEventUnchecked(View.java:22138)
       at androidx.core.view.AccessibilityDelegateCompat.sendAccessibilityEventUnchecked(AccessibilityDelegateCompat.java:196)
       at androidx.core.view.AccessibilityDelegateCompat$AccessibilityDelegateAdapter.sendAccessibilityEventUnchecked(AccessibilityDelegateCompat.java:113)
       at android.view.View.sendAccessibilityEventUnchecked(View.java:5816)
       at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.run(ViewRootImpl.java:7154)
       at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.runOrPost(ViewRootImpl.java:7180)
       at android.view.ViewRootImpl.postSendWindowContentChangedCallback(ViewRootImpl.java:6294)
       at android.view.ViewRootImpl.notifySubtreeAccessibilityStateChanged(ViewRootImpl.java:6473)
       at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3001)
       at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3001)
       at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3001)
       at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3001)
       at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3001)
       at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3001)
       at android.view.View.notifySubtreeAccessibilityStateChangedIfNeeded(View.java:8806)
       at android.view.ViewGroup.addViewInner(ViewGroup.java:4370)
       at android.view.ViewGroup.addView(ViewGroup.java:4145)
       at android.view.ViewGroup.addView(ViewGroup.java:4086)
       at android.view.ViewGroup.addView(ViewGroup.java:4059)
       at androidx.compose.ui.platform.AndroidComposeView.getAndroidViewsHandler(AndroidComposeView.android.kt:233)
       at androidx.compose.ui.platform.AndroidComposeView.addAndroidView(AndroidComposeView.android.kt:402)
       at androidx.compose.ui.viewinterop.AndroidViewHolder$layoutNode$1$3.invoke(AndroidViewHolder.android.kt:211)
       at androidx.compose.ui.viewinterop.AndroidViewHolder$layoutNode$1$3.invoke(AndroidViewHolder.android.kt:210)
       at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:329)
       at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:322)
       at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:322)
       at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:322)
       at androidx.compose.ui.node.LayoutNode.insertAt$ui_release(LayoutNode.kt:217)
       at androidx.compose.ui.node.UiApplier.insertBottomUp(UiApplier.android.kt:32)
       at androidx.compose.ui.node.UiApplier.insertBottomUp(UiApplier.android.kt:22)
       at androidx.compose.runtime.ComposerImpl$createNode$3.invoke(Composer.kt:1505)
       at androidx.compose.runtime.ComposerImpl$createNode$3.invoke(Composer.kt:1500)
       at androidx.compose.runtime.ComposerImpl$recordInsert$2.invoke(Composer.kt:2807)
       at androidx.compose.runtime.ComposerImpl$recordInsert$2.invoke(Composer.kt:2804)
       at androidx.compose.runtime.ComposerImpl.applyChanges$runtime_release(Composer.kt:1387)
       at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:414)
       at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:699)
       at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:3024)
       at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:304)
       at androidx.compose.ui.layout.SubcomposeLayoutState.subcomposeInto(SubcomposeLayout.kt:184)
       at androidx.compose.ui.layout.SubcomposeLayoutState.access$subcomposeInto(SubcomposeLayout.kt:100)
       at androidx.compose.ui.layout.SubcomposeLayoutState$subcompose$2.invoke(SubcomposeLayout.kt:160)
       at androidx.compose.ui.layout.SubcomposeLayoutState$subcompose$2.invoke(SubcomposeLayout.kt:158)
       at androidx.compose.runtime.snapshots.SnapshotStateObserver.withNoObservations(SnapshotStateObserver.kt:137)
       at androidx.compose.ui.node.OwnerSnapshotObserver.withNoSnapshotReadObservation$ui_release(OwnerSnapshotObserver.kt:49)
       at androidx.compose.ui.node.LayoutNode.withNoSnapshotReadObservation$ui_release(LayoutNode.kt:1086)
       at androidx.compose.ui.layout.SubcomposeLayoutState.subcompose(SubcomposeLayout.kt:158)
       at androidx.compose.ui.layout.SubcomposeLayoutState.subcompose(SubcomposeLayout.kt:152)
       at androidx.compose.material.ModalBottomSheetKt$BottomSheetStack$1$1.invoke-0kLqBqw(ModalBottomSheet.kt:344)
       at androidx.compose.material.ModalBottomSheetKt$BottomSheetStack$1$1.invoke(ModalBottomSheet.kt:336)
       at androidx.compose.ui.layout.SubcomposeLayoutState$createMeasurePolicy$1.measure-3p2s80s(SubcomposeLayout.kt:212)
       at androidx.compose.ui.node.InnerPlaceable.performMeasure-BRTryo0(InnerPlaceable.kt:45)
       at androidx.compose.ui.node.LayoutNodeWrapper.measure-BRTryo0(LayoutNodeWrapper.kt:156)
       at androidx.compose.ui.node.OuterMeasurablePlaceable$remeasure$2.invoke(OuterMeasurablePlaceable.kt:97)
       at androidx.compose.ui.node.OuterMeasurablePlaceable$remeasure$2.invoke(OuterMeasurablePlaceable.kt:96)
       at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:121)
       at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:75)
       at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:63)
       at androidx.compose.ui.node.OuterMeasurablePlaceable.remeasure-BRTryo0(OuterMeasurablePlaceable.kt:96)
       at androidx.compose.ui.node.OuterMeasurablePlaceable.measure-BRTryo0(OuterMeasurablePlaceable.kt:68)
       at androidx.compose.ui.node.LayoutNode.measure-BRTryo0(LayoutNode.kt:1195)
       at androidx.compose.ui.layout.RootMeasurePolicy.measure-3p2s80s(RootMeasurePolicy.kt:37)
       at androidx.compose.ui.node.InnerPlaceable.performMeasure-BRTryo0(InnerPlaceable.kt:45)
       at androidx.compose.ui.node.LayoutNodeWrapper.measure-BRTryo0(LayoutNodeWrapper.kt:156)
       at androidx.compose.ui.node.DelegatingLayoutNodeWrapper.performMeasure-BRTryo0(DelegatingLayoutNodeWrapper.kt:108)
       at androidx.compose.ui.node.LayoutNodeWrapper.measure-BRTryo0(LayoutNodeWrapper.kt:156)
       at androidx.compose.ui.node.DelegatingLayoutNodeWrapper.performMeasure-BRTryo0(DelegatingLayoutNodeWrapper.kt:108)
       at androidx.compose.ui.node.LayoutNodeWrapper.measure-BRTryo0(LayoutNodeWrapper.kt:156)
       at androidx.compose.ui.node.DelegatingLayoutNodeWrapper.performMeasure-BRTryo0(DelegatingLayoutNodeWrapper.kt:108)
       at androidx.compose.ui.node.LayoutNodeWrapper.measure-BRTryo0(LayoutNodeWrapper.kt:156)
       at androidx.compose.ui.node.DelegatingLayoutNodeWrapper.performMeasure-BRTryo0(DelegatingLayoutNodeWrapper.kt:108)
       at androidx.compose.ui.node.LayoutNodeWrapper.measure-BRTryo0(LayoutNodeWrapper.kt:156)
       at androidx.compose.ui.node.OuterMeasurablePlaceable$remeasure$2.invoke(OuterMeasurablePlaceable.kt:97)
       at androidx.compose.ui.node.OuterMeasurablePlaceable$remeasure$2.invoke(OuterMeasurablePlaceable.kt:96)
       at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:1714)
       at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:116)
       at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:75)
       at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:63)
       at androidx.compose.ui.node.OuterMeasurablePlaceable.remeasure-BRTryo0(OuterMeasurablePlaceable.kt:96)
       at androidx.compose.ui.node.LayoutNode.remeasure-BRTryo0$ui_release(LayoutNode.kt:1202)
       at androidx.compose.ui.node.MeasureAndLayoutDelegate.doRemeasure-0kLqBqw(MeasureAndLayoutDelegate.kt:170)
       at androidx.compose.ui.node.MeasureAndLayoutDelegate.access$doRemeasure-0kLqBqw(MeasureAndLayoutDelegate.kt:39)
       at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureAndLayout(MeasureAndLayoutDelegate.kt:211)
       at androidx.compose.ui.platform.AndroidComposeView.measureAndLayout(AndroidComposeView.android.kt:448)
       at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:581)
       at android.view.View.draw(View.java:16187)
       at android.view.View.updateDisplayListIfDirty(View.java:15180)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
       at android.view.View.updateDisplayListIfDirty(View.java:15140)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
       at android.view.View.updateDisplayListIfDirty(View.java:15140)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
       at android.view.View.updateDisplayListIfDirty(View.java:15140)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
       at android.view.View.updateDisplayListIfDirty(View.java:15140)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
       at android.view.View.updateDisplayListIfDirty(View.java:15140)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
       at android.view.View.updateDisplayListIfDirty(View.java:15140)
       at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
       at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
       at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:322)
       at android.view.ViewRootImpl.draw(ViewRootImpl.java:2615)
       at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2434)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2067)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
       at android.view.Choreographer.doCallbacks(Choreographer.java:670)
       at android.view.Choreographer.doFrame(Choreographer.java:606)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5421)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
 

Я не могу воспроизвести выполнение, и из Stracktrace я не могу прочитать, на какую часть моего приложения влияет исключение.

Мой Вопрос:

  • Знаете ли вы это исключение и знаете, что может его вызвать
  • Как я могу исследовать эту проблему и найти причину, если я не могу воспроизвести проблему на своих тестовых устройствах.

Любые советы будут оценены по достоинству

Ответ №1:

Похоже, это была ошибка, которая была исправлена в прошлый четверг.

Я недостаточно знаю об их системах, чтобы знать наверняка, когда это будет выпущено, но я предполагаю, что это будет beta04 .

Комментарии:

1. Большое спасибо. Не будет ли он выпущен в beta03 (предположительно запланирован на следующую среду)?

2. @Янник: beta03 должно быть через два дня, так что я сомневаюсь, что это будет включено туда, вот почему я догадался beta04 .

3. Облом! Вероятно, придется подождать две недели, прежде чем приступить к производству