Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash after updating compose libraries #8

Closed
medico-kmdev opened this issue Jun 21, 2023 · 4 comments
Closed

Crash after updating compose libraries #8

medico-kmdev opened this issue Jun 21, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@medico-kmdev
Copy link

Device - one plus 10r
Android - 13

const val composeUi = "1.4.3"
const val composeFoundation = "1.4.3"
const val composeCompiler = "1.4.7"

`FATAL EXCEPTION: main
                                                                                                Process: com.zealsoftsol.medico.dev, PID: 6936
                                                                                                java.lang.IllegalStateException: Expected BringIntoViewRequester to not be used before parents are placed.
                                                                                                	at androidx.compose.foundation.gestures.ContentInViewModifier.calculateRectForParent(ContentInViewModifier.kt:117)
                                                                                                	at androidx.compose.foundation.relocation.BringIntoViewResponderModifier$bringChildIntoView$parentRect$1.invoke(BringIntoViewResponder.kt:152)
                                                                                                	at androidx.compose.foundation.relocation.BringIntoViewResponderModifier$bringChildIntoView$parentRect$1.invoke(BringIntoViewResponder.kt:152)
                                                                                                	at androidx.compose.foundation.relocation.AndroidBringIntoViewParent.bringChildIntoView(BringIntoViewResponder.android.kt:43)
                                                                                                	at androidx.compose.foundation.relocation.BringIntoViewResponderModifier$bringChildIntoView$2$2.invokeSuspend(BringIntoViewResponder.kt:171)
                                                                                                	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                                                                                                	at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
                                                                                                	at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
                                                                                                	at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
                                                                                                	at android.os.Handler.handleCallback(Handler.java:942)
                                                                                                	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                	at android.os.Looper.loopOnce(Looper.java:240)
                                                                                                	at android.os.Looper.loop(Looper.java:351)
                                                                                                	at android.app.ActivityThread.main(ActivityThread.java:8416)
                                                                                                	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
                                                                                                	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
                                                                                                	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@16ff7b7, androidx.compose.runtime.BroadcastFrameClock@8b06b24, StandaloneCoroutine{Cancelling}@59ac68d, AndroidUiDispatcher@973b042]`
@TheEnsis
Copy link

TheEnsis commented Jul 2, 2023

I also found this error too

@yogeshpaliyal
Copy link
Owner

Will work on this ASAP

@yogeshpaliyal yogeshpaliyal added the bug Something isn't working label Jul 2, 2023
@medico-kmdev
Copy link
Author

one simple change that worked for me was to request focus in onfocusChanged

OtpCell( modifier = cellModifier .size(width = 45.dp, height = 45.dp) .clip(MaterialTheme.shapes.large) .background( MaterialTheme.colors.primary.copy(alpha = 0.1f), shape = RoundedCornerShape(3.dp) ) .onFocusChanged { focusRequester.requestFocus() } .clickable { keyboard?.show() }, value = value.getOrNull(it), isCursorVisible = value.length == it, obscureText )

@TheEnsis
Copy link

TheEnsis commented Jul 6, 2023

one simple change that worked for me was to request focus in onfocusChanged

OtpCell( modifier = cellModifier .size(width = 45.dp, height = 45.dp) .clip(MaterialTheme.shapes.large) .background( MaterialTheme.colors.primary.copy(alpha = 0.1f), shape = RoundedCornerShape(3.dp) ) .onFocusChanged { focusRequester.requestFocus() } .clickable { keyboard?.show() }, value = value.getOrNull(it), isCursorVisible = value.length == it, obscureText )

it work now!! Thank you.

@yogeshpaliyal yogeshpaliyal pinned this issue Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants