Stylianos Gakis
11/08/2022, 4:33 PMjava.lang.ArrayIndexOutOfBoundsException: src.length=16 srcPos=12 dst.length=16 dstPos=11 length=-7
(edit) Seems like movableContentOf + SubCompose still don’t play well with each other even after the 1.3 fix which should fix some of the problems this combo had.Stylianos Gakis
11/08/2022, 4:34 PMjava.lang.ArrayIndexOutOfBoundsException: src.length=16 srcPos=12 dst.length=16 dstPos=11 length=-7
at java.lang.System.arraycopy(Native Method)
at kotlin.collections.ArraysKt___ArraysJvmKt.copyInto(_ArraysJvm.kt:1247)
at androidx.compose.runtime.collection.MutableVector.removeAt(MutableVector.kt:795)
at androidx.compose.ui.node.MutableVectorWithMutationTracking.removeAt(MutableVectorWithMutationTracking.kt:43)
at androidx.compose.ui.node.LayoutNode.removeAt$ui_release(LayoutNode.kt:287)
at androidx.compose.ui.node.UiApplier.remove(UiApplier.android.kt:35)
at androidx.compose.runtime.ComposerImpl$realizeMovement$1.invoke(Composer.kt:3769)
at androidx.compose.runtime.ComposerImpl$realizeMovement$1.invoke(Composer.kt:3769)
at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:808)
at androidx.compose.runtime.CompositionImpl.dispose(Composition.kt:608)
at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.disposeCurrentNodes(SubcomposeLayout.kt:705)
at androidx.compose.ui.layout.SubcomposeLayoutState.disposeCurrentNodes$ui_release(SubcomposeLayout.kt:230)
at androidx.compose.ui.layout.SubcomposeLayoutKt$SubcomposeLayout$5$1$invoke$$inlined$onDispose$1.dispose(Effects.kt:485)
at androidx.compose.runtime.DisposableEffectImpl.onForgotten(Effects.kt:85)
at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1080)
at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:818)
at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:839)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:585)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:503)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:970)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
at android.view.Choreographer.doFrame(Choreographer.java:727)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@28aa296, androidx.compose.ui.platform.MotionDurationScaleImpl@8951e17, StandaloneCoroutine{Cancelling}@3730204, AndroidUiDispatcher@5ad43ed]
jw
11/08/2022, 4:39 PMStylianos Gakis
11/08/2022, 4:40 PMStylianos Gakis
11/08/2022, 6:05 PM258053979
and this is my minimal reproduction repository https://github.com/StylianosGakis/subcompose-movablecontent-bug
I posted it on Android Public Tracker > App Development > Jetpack Compose > Compiler plug-in and runtime
as I assumed this has to be a problem in the runtime
artifact since movableContentOf lives there.
There were some changes that were supposed to enable this interaction in compose 1.3 after I remember having this discussion https://kotlinlang.slack.com/archives/CJLTWPH7S/p1660896793260219 which links to this commit https://android-review.googlesource.com/c/platform/frameworks/support/+/2199821. But alas it seems like it’s not entirely working yet.jw
11/08/2022, 6:07 PMjw
11/08/2022, 6:08 PMStylianos Gakis
11/08/2022, 6:09 PMStylianos Gakis
11/08/2022, 6:09 PMjw
11/08/2022, 6:09 PMStylianos Gakis
11/08/2022, 6:09 PMjw
11/08/2022, 6:10 PMjw
11/08/2022, 6:11 PMStylianos Gakis
11/08/2022, 6:15 PMModalBottomSheetLayout
on the first if branch (this has the SubCompose call) and the other branch was just some `Box`es and `Column`s (No SubCompose existing on this call)shikasd
11/08/2022, 7:09 PMStylianos Gakis
11/08/2022, 7:12 PMshikasd
11/08/2022, 7:17 PMLeland Richardson [G]
11/08/2022, 10:43 PMLeland Richardson [G]
11/08/2022, 10:51 PMStylianos Gakis
11/08/2022, 11:05 PMLeland Richardson [G]
11/08/2022, 11:08 PMStylianos Gakis
11/08/2022, 11:58 PM