Skip to content

Fatal Exception: java.lang.StringIndexOutOfBoundsException: begin 2, end 52, length 50 #716

@mianaliasjad

Description

@mianaliasjad

I have been using this awesome library in my app for one year. This exception was occurring in the version v1.0.0-rc13 but then I saw the change log of version v1.0.0-rc14 and it specified the fix of StringIndexOutOfBoundsException. But it is still showing up in the version v1.0.0-rc14, maybe it's another variant of the same exception.

Fatal Exception: java.lang.StringIndexOutOfBoundsException: begin 2, end 52, length 50 at java.lang.String.checkBoundsBeginEnd(String.java:4930) at java.lang.String.substring(String.java:2948) at com.mohamedrejeb.richeditor.utils.AnnotatedStringExtKt.append-UJKp_GQ(AnnotatedStringExt.kt:142) at com.mohamedrejeb.richeditor.utils.AnnotatedStringExtKt.appendRichSpan-XtCa3Zc(AnnotatedStringExt.kt:56) at com.mohamedrejeb.richeditor.utils.AnnotatedStringExtKt.appendRichSpan-XtCa3Zc$default(AnnotatedStringExt.kt:42) at com.mohamedrejeb.richeditor.utils.AnnotatedStringExtKt.append-UJKp_GQ(AnnotatedStringExt.kt:28) at com.mohamedrejeb.richeditor.model.RichTextState.updateAnnotatedString$richeditor_compose_release(RichTextState.kt:2324) at com.mohamedrejeb.richeditor.model.RichTextState.updateTextFieldValue(RichTextState.kt:2113) at com.mohamedrejeb.richeditor.model.RichTextState.updateTextFieldValue$default(RichTextState.kt:2080) at com.mohamedrejeb.richeditor.model.RichTextState.onTextFieldValueChangeInner(RichTextState.kt:2072) at com.mohamedrejeb.richeditor.model.RichTextState.onTextFieldValueChange$richeditor_compose_release(RichTextState.kt:1974) at com.mohamedrejeb.richeditor.ui.BasicRichTextEditorKt.BasicRichTextEditor$lambda$9$1$0(BasicRichTextEditor.kt:276) at androidx.compose.foundation.text.BasicTextFieldKt.BasicTextField$lambda$27$0(BasicTextField.kt:912) at androidx.compose.foundation.text.LegacyTextFieldState.onValueChange$lambda$0(LegacyTextFieldState.java:909) at androidx.compose.foundation.text.TextFieldDelegate$Companion.onEditCommand$foundation(TextFieldDelegate.java:293) at androidx.compose.foundation.text.TextFieldDelegate$Companion.restartInput$lambda$0(TextFieldDelegate.java:342) at androidx.compose.foundation.text.input.internal.LegacyTextInputMethodRequest$createInputConnection$1.onEditCommands(LegacyTextInputMethodRequest.java:274) at androidx.compose.foundation.text.input.internal.RecordingInputConnection.endBatchEditInternal(RecordingInputConnection.android.kt:191) at androidx.compose.foundation.text.input.internal.RecordingInputConnection.endBatchEdit(RecordingInputConnection.java:185) at androidx.compose.ui.text.input.NullableInputConnectionWrapperApi21.endBatchEdit(NullableInputConnectionWrapperApi21.java:150) at android.view.inputmethod.RemoteInputConnectionImpl.lambda$endBatchEdit$35(RemoteInputConnectionImpl.java:1002) at android.view.inputmethod.RemoteInputConnectionImpl.$r8$lambda$dyvX76mWLIMlRRSgQ0CT-rRsrEE() at android.view.inputmethod.RemoteInputConnectionImpl$$ExternalSyntheticLambda13.run(D8$$SyntheticClass) at android.os.Handler.handleCallback(Handler.java:1037) at android.os.Handler.dispatchMessage(Handler.java:108) at android.os.Looper.loopOnce(Looper.java:304) at android.os.Looper.loop(Looper.java:430) at android.app.ActivityThread.main(ActivityThread.java:9345) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:953)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions