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

[BUG] Crash due to java.lang.IllegalArgumentException: offset(6) is out of bounds [0, 0) #9300

Closed
semamu opened this issue Sep 20, 2024 · 3 comments
Labels

Comments

@semamu
Copy link

semamu commented Sep 20, 2024

Summary

Crash on some devices when PaymentSheet is opened

Android version

Android API 34 (14)
Android API 33 (13)
Android API 29 (10)

Impacted devices

Huawei
Honor

Installation method

Installed through the gradle dependency com.stripe:stripe-android

Dependency Versions

kotlin: 2.0.0
stripe-android: 20.47.0
Android Gradle Plugin: 8.5.1
Gradle: 8.7

Stack trace:

 Fatal Exception: java.lang.IllegalArgumentException: offset(6) is out of bounds [0, 0)
       at androidx.compose.ui.text.MultiParagraph.requireIndexInRange(MultiParagraph.kt:831)
       at androidx.compose.ui.text.MultiParagraph.getBoundingBox(MultiParagraph.kt:505)
       at androidx.compose.ui.text.TextLayoutResult.getBoundingBox(TextLayoutResult.kt:527)
       at androidx.compose.foundation.text.TextFieldDelegate$Companion.notifyFocusedRect$foundation_release(TextFieldDelegate.java:166)
       at androidx.compose.foundation.text.CoreTextFieldKt.notifyFocusedRect(CoreTextField.kt:1179)
       at androidx.compose.foundation.text.CoreTextFieldKt.startInputSession(CoreTextField.kt:1022)
       at androidx.compose.foundation.text.CoreTextFieldKt.access$startInputSession(CoreTextField.kt:1)
       at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$focusModifier$1.invoke(CoreTextField.kt:309)
       at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$focusModifier$1.invoke(CoreTextField.kt:297)
       at androidx.compose.ui.focus.FocusChangedNode.onFocusEvent(FocusChangedModifier.kt:59)
       at androidx.compose.ui.focus.FocusEventModifierNodeKt.refreshFocusEventNodes(FocusEventModifierNode.kt:68)
       at androidx.compose.ui.focus.FocusTransactionsKt.performRequestFocus(FocusTransactions.kt:77)
       at androidx.compose.ui.focus.FocusOwnerImpl$moveFocus$foundNextItem$1.invoke(FocusOwnerImpl.java:191)
       at androidx.compose.ui.focus.FocusOwnerImpl$moveFocus$foundNextItem$1.invoke(FocusOwnerImpl.java:180)
       at androidx.compose.ui.focus.OneDimensionalFocusSearchKt.forwardFocusSearch(OneDimensionalFocusSearch.kt:59)
       at androidx.compose.ui.focus.OneDimensionalFocusSearchKt.searchChildren-4C6V_qg(OneDimensionalFocusSearch.kt:134)
       at androidx.compose.ui.focus.OneDimensionalFocusSearchKt.generateAndSearchChildren-4C6V_qg(OneDimensionalFocusSearch.kt:105)
       at androidx.compose.ui.focus.OneDimensionalFocusSearchKt.forwardFocusSearch(OneDimensionalFocusSearch.kt:55)
       at androidx.compose.ui.focus.OneDimensionalFocusSearchKt.forwardFocusSearch(OneDimensionalFocusSearch.kt:54)
       at androidx.compose.ui.focus.OneDimensionalFocusSearchKt.oneDimensionalFocusSearch--OM-vw8(OneDimensionalFocusSearch.kt:44)
       at androidx.compose.ui.focus.FocusTraversalKt.focusSearch-sMXa3k8(FocusTraversal.kt:105)
       at androidx.compose.ui.focus.FocusOwnerImpl.moveFocus-3ESFkO8(FocusOwnerImpl.kt:180)
       at com.stripe.android.uicore.elements.TextFieldUIKt$TextField$3.invokeSuspend(TextFieldUI.kt:157)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
       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:996)
       at android.os.Handler.dispatchMessage(Handler.java:110)
       at android.os.Looper.loopOnce(Looper.java:210)
       at android.os.Looper.loop(Looper.java:302)
       at android.app.ActivityThread.main(ActivityThread.java:9652)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:601)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1062)
@semamu semamu added the bug label Sep 20, 2024
@tjclawson-stripe
Copy link
Collaborator

Hi @semamu, thanks for reporting this. We've created a ticket to investigate.

@jaynewstrom-stripe
Copy link
Collaborator

@semamu we released a new version with a compose update yesterday. Would you mind giving that a try and seeing if you can reproduce the issue?

@jaynewstrom-stripe
Copy link
Collaborator

Please reopen if you can still reproduce this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants