“在已经放置的节点上调用了放置”
2021-12-13
1523
我已将 Jetpack Compose 从 1.1.0-beta03 升级到 1.1.0-beta04,除了需要进行一些更改外没有发生任何变化,但现在我在“DetailScreen”上启动应用程序时出现此错误。
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.antigaspi, PID: 6067
java.lang.IllegalStateException: Place was called on a node which was placed already
at androidx.compose.ui.node.LayoutNode.onNodePlaced$ui_release(LayoutNode.kt:941)
at androidx.compose.ui.node.InnerPlaceable.placeAt-f8xVGno(InnerPlaceable.kt:125)
at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:31)
at androidx.compose.ui.layout.Placeable$PlacementScope.placeRelative(Placeable.kt:359)
at androidx.compose.ui.layout.Placeable$PlacementScope.placeRelative$default(Placeable.kt:179)
at androidx.compose.foundation.layout.PaddingModifier$measure$1.invoke(Padding.kt:370)
at androidx.compose.foundation.layout.PaddingModifier$measure$1.invoke(Padding.kt:368)
at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:68)
at androidx.compose.ui.node.DelegatingLayoutNodeWrapper.placeAt-f8xVGno(DelegatingLayoutNodeWrapper.kt:126)
at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:31)
at androidx.compose.ui.layout.Placeable$PlacementScope.place-70tqf50(Placeable.kt:370)
at androidx.compose.ui.node.OuterMeasurablePlaceable.placeOuterWrapper-f8xVGno(OuterMeasurablePlaceable.kt:171)
at androidx.compose.ui.node.OuterMeasurablePlaceable.access$placeOuterWrapper-f8xVGno(OuterMeasurablePlaceable.kt:28)
2个回答
这是 Compose 1.1.0-beta04 中的一个 已知问题 ,已在 Compose 的下一版本中修复。遗憾的是,在下一版本发布之前,没有任何解决方法。
ianhanniballake
2021-12-13
该问题已在 Compose 1.1.0-rc01 中修复,现已可用。
Mario Huizinga
2021-12-16