Closed aphex- closed 1 month ago
Okey this also happens in other situations for example if I want to target a Composable in a 'trailingIcon' of a TextField
I think instead of trying to consume the coordinates of a composable that was previously drawn, it should force a re-composition or something like that.
Sorry to say but I got a few crashes from users using v2.0.1
Fatal Exception: java.lang.IllegalStateException: LayoutCoordinate operations are only valid when isAttached is true at androidx.compose.ui.node.NodeCoordinator.getParentLayoutCoordinates(NodeCoordinator.kt:255) at androidx.compose.ui.layout.LayoutCoordinatesKt.findRootCoordinates(LayoutCoordinates.kt:180) at androidx.compose.ui.layout.LayoutCoordinatesKt.boundsInWindow(LayoutCoordinates.kt:134) at com.canopas.lib.showcase.component.ShowcaseContentKt.ShowcaseContent(ShowcaseContent.kt:76) at com.canopas.lib.showcase.component.ShowcaseContentKt$ShowcaseContent$6.invoke(ShowcaseContent.kt:103) at com.canopas.lib.showcase.component.ShowcaseContentKt$ShowcaseContent$6.invoke(ShowcaseContent.kt:103) at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.java:192) at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2556) at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2827) at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3314) at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3265) at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:940) at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1155) at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:127) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:583) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.java:551) at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:41) at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.java:109) at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.java:41) at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1648) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1659) at android.view.Choreographer.doCallbacks(Choreographer.java:1129) at android.view.Choreographer.doFrame(Choreographer.java:1045) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1622) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8900) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
When will this fix be released, please? Thanks
With v2.0.2, this crash is fixed!
Hello. I am getting the following exception:
If I debug into the code I can confirm that the 'targetCords.isAttached' is false and the call of 'targetCords.boundsInWindow()' leads to the exception.
My guess is it has something to do with the fact that I am using a LazyColum. But anyway.. It might be better to handle the 'isAttached == false' case in the library than letting the app crash?