louiscad
05/10/2025, 12:34 AMArrayIndexOutOfBoundsException
when ImageComposeScene.use { … }
exits.
Could it be caused by Compose Hot Reload, or is it something different?
This is with Compose Hot Reload 1.0.0-alpha09 and Compose 1.8.0-rc01 on macOS.
Index -331 out of bounds for length 640
java.lang.ArrayIndexOutOfBoundsException: Index -331 out of bounds for length 640
at androidx.compose.runtime.SlotWriter.moveSlotGapTo(SlotTable.kt:4174)
at androidx.compose.runtime.SlotWriter.removeSlots(SlotTable.kt:2904)
at androidx.compose.runtime.SlotWriter.removeGroup(SlotTable.kt:2021)
at androidx.compose.runtime.ComposerKt.removeCurrentGroup(Composer.kt:4337)
at androidx.compose.runtime.CompositionImpl.dispose(Composition.kt:840)
at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.disposeCurrentNodes(SubcomposeLayout.kt:638)
at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.onRelease(SubcomposeLayout.kt:450)
at androidx.compose.ui.node.LayoutNode.onRelease(LayoutNode.kt:1428)
at androidx.compose.runtime.internal.RememberEventDispatcher.dispatchRememberObservers(RememberEventDispatcher.kt:163)
at androidx.compose.runtime.CompositionImpl.dispose(Composition.kt:843)
at androidx.compose.ui.scene.BaseComposeScene.close(BaseComposeScene.skiko.kt:128)
at androidx.compose.ui.scene.CanvasLayersComposeSceneImpl.close(CanvasLayersComposeScene.skiko.kt:194)
at androidx.compose.ui.ImageComposeScene.close(ImageComposeScene.skiko.kt:178)
Sebastian Sellmair [JB]
05/10/2025, 8:53 AMSebastian Sellmair [JB]
05/10/2025, 8:56 AMlouiscad
05/10/2025, 8:57 AMSebastian Sellmair [JB]
05/10/2025, 8:58 AMlouiscad
05/10/2025, 8:59 AMSebastian Sellmair [JB]
05/10/2025, 8:59 AMlouiscad
05/10/2025, 9:00 AMSebastian Sellmair [JB]
05/10/2025, 9:00 AMSebastian Sellmair [JB]
05/10/2025, 9:02 AMlouiscad
05/10/2025, 9:02 AMIndex -171 out of bounds for length 640
louiscad
05/10/2025, 9:02 AMSebastian Sellmair [JB]
05/10/2025, 9:03 AMlouiscad
05/10/2025, 9:03 AMlouiscad
05/10/2025, 9:04 AMSebastian Sellmair [JB]
05/10/2025, 9:05 AMSebastian Sellmair [JB]
05/10/2025, 9:05 AMlouiscad
05/10/2025, 9:06 AMalias(libs.plugins.composeHotReload) apply false
from the root build.gradle.kts
file?Sebastian Sellmair [JB]
05/10/2025, 9:07 AMlouiscad
05/10/2025, 9:07 AMlouiscad
05/10/2025, 9:10 AMlouiscad
05/10/2025, 9:10 AMIndex -171 out of bounds for length 640
Sebastian Sellmair [JB]
05/10/2025, 9:12 AMlouiscad
05/10/2025, 9:12 AMClassCastException: class androidx.compose.foundation.layout.FillNode cannot be cast to class androidx.compose.foundation.text.modifiers.TextStringSimpleNode (androidx.compose.foundation.layout.FillNode and androidx.compose.foundation.text.modifiers.TextStringSimpleNode are in unnamed module of loader 'app')
louiscad
05/10/2025, 9:13 AMException in thread "DefaultDispatcher-worker-5" java.lang.NullPointerException
at androidx.compose.ui.node.NodeChain$Differ.insert(NodeChain.kt:445)
at androidx.compose.ui.node.MyersDiffKt.applyDiff(MyersDiff.kt:122)
at androidx.compose.ui.node.MyersDiffKt.executeDiff(MyersDiff.kt:135)
at androidx.compose.ui.node.NodeChain.structuralUpdate(NodeChain.kt:546)
at androidx.compose.ui.node.NodeChain.updateFrom$ui(NodeChain.kt:204)
at androidx.compose.ui.node.LayoutNode.applyModifier(LayoutNode.kt:950)
at androidx.compose.ui.node.LayoutNode.setModifier(LayoutNode.kt:939)
at androidx.compose.ui.node.ComposeUiNode$Companion.SetModifier$lambda$1(ComposeUiNode.kt:41)
at androidx.compose.runtime.Applier.apply(Applier.kt:180)
at androidx.compose.runtime.changelist.Operation$UpdateNode.execute(Operation.kt:551)
at androidx.compose.runtime.changelist.Operations.executeAndFlushAllPendingOperations(Operations.kt:349)
at androidx.compose.runtime.changelist.ChangeList.executeAndFlushAllPendingChanges(ChangeList.kt:88)
at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:1036)
at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1067)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2.invokeSuspend$lambda$21(Recomposer.kt:684)
at androidx.compose.runtime.BroadcastFrameClock$FrameAwaiter.resume(BroadcastFrameClock.kt:43)
at androidx.compose.runtime.BroadcastFrameClock.sendFrame(BroadcastFrameClock.kt:75)
at androidx.compose.ui.scene.BaseComposeScene.render(BaseComposeScene.skiko.kt:174)
at androidx.compose.ui.ImageComposeScene.render(ImageComposeScene.skiko.kt:229)
at com.louiscad.playground.compose.videogen.lib.ComposeToVideoKt$images$1.invokeSuspend(ComposeToVideo.kt:117)
Yup, last line is leaking the project topicSebastian Sellmair [JB]
05/10/2025, 9:13 AMlouiscad
05/10/2025, 9:23 AM--no-build-cache --no-configuration-cache --rerun-tasks
louiscad
05/10/2025, 9:40 AMcomposeApp
module, drag'N'drop an empty directory to the gray square.
It should generate frames and record them as webp in the given dir (showing the count), then generate a transparent video from those webps named output.mov
that should contain a counter going from 00 to 09. If you want to try again, drag another empty dir, or delete output.mov
and drag the same dir.louiscad
05/10/2025, 11:05 AMImageScene
doesn't like its use { }
, I mean, its close()
function to be called too quickly after having been instantiated. Still testing…louiscad
05/10/2025, 11:20 AMdelay(5.seconds)
at the last line of the use { ... }
block, and I have yet to see the issue.louiscad
05/10/2025, 4:14 PMImageSceneCompose.close()
isn't idempotent:
java.lang.IllegalStateException: ComposeScene is already closed
at androidx.compose.ui.scene.CanvasLayersComposeSceneImpl.close(CanvasLayersComposeScene.skiko.kt:190)
at androidx.compose.ui.ImageComposeScene.close(ImageComposeScene.skiko.kt:178)
at com.louiscad.playground.compose.videogen.lib.ComposeToVideoKt.recordComposableAsVideo-3KjBteM(ComposeToVideo.kt:260)
at com.louiscad.playground.compose.videogen.lib.ComposeToVideoKt$recordComposableAsVideo$1.invokeSuspend(ComposeToVideo.kt)