Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
128 views
in Technique[技术] by (71.8m points)

android - Jetpack Compose: "MeasuringIntrinsicsMeasureBlocks is not ready. layoutState is NeedsRelayout"

I'm receiving some crashes that I cannot relate to our own code, but it happens fairly often. It mostly seems to occur when the UI is updated rapidly, but I'm unable to reproduce it consistently.

I'm using

  • Compose version 1.0.0-alpha10
  • AGP version 7.0.0-alpha04

The stacktrace:

Fatal Exception: java.lang.IllegalArgumentException: e@b4fb400 children: 4 measureBlocks: MeasuringIntrinsicsMeasureBlocks@34b1caf{ measureBlock=b.e.b.t.f$c@812b8bc } is not ready. layoutState is NeedsRelayout
       at androidx.compose.ui.node.InnerPlaceable.performDraw(InnerPlaceable.java:94)
       at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.java:34)
       at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.java:9)
       at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.java:34)
       at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.java:9)
       at androidx.compose.ui.node.InnerPlaceable.performDraw(InnerPlaceable.java:60)
       at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.java:34)
       at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.java:9)
       at androidx.compose.ui.node.InnerPlaceable.performDraw(InnerPlaceable.java:60)
       at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(LayoutNodeWrapper.java:4)
       at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(LayoutNodeWrapper.java)
       at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.java:62)
       at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.java:51)
       at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.java:17)
       at androidx.compose.ui.node.LayoutNodeWrapper.invoke(LayoutNodeWrapper.java:40)
       at androidx.compose.ui.node.LayoutNodeWrapper.invoke(LayoutNodeWrapper.java:2)
       at androidx.compose.ui.platform.ViewLayer.dispatchDraw(ViewLayer.java:44)
       at android.view.View.draw(View.java:21963)
       at android.view.View.updateDisplayListIfDirty(View.java:20833)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5132)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5104)
       at android.view.View.updateDisplayListIfDirty(View.java:20788)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5132)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5104)
       at android.view.View.updateDisplayListIfDirty(View.java:20788)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5132)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5104)
       at android.view.View.updateDisplayListIfDirty(View.java:20788)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5132)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5104)
       at android.view.View.updateDisplayListIfDirty(View.java:20788)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5132)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5104)
       at android.view.View.updateDisplayListIfDirty(View.java:20788)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5132)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5104)
       at android.view.View.updateDisplayListIfDirty(View.java:20788)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5132)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5104)
       at android.view.View.updateDisplayListIfDirty(View.java:20788)
       at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:725)
       at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:731)
       at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:840)
       at android.view.ViewRootImpl.draw(ViewRootImpl.java:4035)
       at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3798)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3100)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1963)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8719)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:988)
       at android.view.Choreographer.doCallbacks(Choreographer.java:765)
       at android.view.Choreographer.doFrame(Choreographer.java:700)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967)
       at android.os.Handler.handleCallback(Handler.java:873)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:216)
       at android.app.ActivityThread.main(ActivityThread.java:7266)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)

What is going on here?

question from:https://stackoverflow.com/questions/65902240/jetpack-compose-measuringintrinsicsmeasureblocks-is-not-ready-layoutstate-is

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...