Status Update
Comments
se...@gmail.com <se...@gmail.com> #2
kl...@google.com <kl...@google.com> #3
Stacktrace:
Caused by: java.lang.IllegalArgumentException: Can not get supported output size under supported maximum for the format: 34
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getSupportedOutputSizes(SupportedSurfaceCombination.java:355)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getSuggestedResolutions(SupportedSurfaceCombination.java:197)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.getSuggestedResolutions(Camera2DeviceSurfaceManager.java:198)
at androidx.camera.core.CameraX.calculateSuggestedResolutions(CameraX.java:943)
at androidx.camera.core.CameraX.bindToLifecycle(CameraX.java:293)
at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:227)
Below are some findings based on our debugging
When Dex is connected
previewConfig.getMaxResolution() is returning "731x411" as maxSize.
Inside Preview.Builder.build() -> Default_MAX_resolution is set to "CameraX.getSurfaceManager().getPreviewSize()" which is 731x411
this is being picked as maxSize.
While rendering maxSize is 731x411 and minSize is 640x480 and below are available outputSizes
0 = {Size@11860} "4032x3024"
1 = {Size@11861} "3984x2988"
2 = {Size@11862} "4032x2268"
3 = {Size@11863} "3024x3024"
4 = {Size@11864} "2976x2976"
5 = {Size@11865} "3840x2160"
6 = {Size@11866} "3264x2448"
7 = {Size@11867} "4032x1960"
8 = {Size@11868} "2880x2160"
9 = {Size@11869} "3264x1836"
10 = {Size@11870} "2160x2160"
11 = {Size@11871} "2560x1440"
12 = {Size@11872} "2224x1080"
13 = {Size@11873} "2048x1152"
14 = {Size@11874} "1920x1080"
15 = {Size@11875} "1440x1080"
16 = {Size@11876} "1088x1088"
17 = {Size@11877} "1280x720"
18 = {Size@11878} "1024x768"
19 = {Size@11879} "1056x704"
20 = {Size@11880} "960x720"
21 = {Size@11881} "960x540"
22 = {Size@11882} "720x720"
23 = {Size@11883} "800x450"
24 = {Size@11884} "720x480"
25 = {Size@11885} "640x480"
26 = {Size@11886} "352x288"
27 = {Size@11887} "320x240"
28 = {Size@11888} "256x144"
29 = {Size@11889} "176x144"
and couldn't find any size in this range.
When Dex not connected
minsize = 640x480
maxsize = 1920x1080
0 = {Size@11836} "4032x3024"
1 = {Size@11837} "3984x2988"
2 = {Size@11838} "4032x2268"
3 = {Size@11839} "3024x3024"
4 = {Size@11840} "2976x2976"
5 = {Size@11841} "3840x2160"
6 = {Size@11842} "3264x2448"
7 = {Size@11843} "4032x1960"
8 = {Size@11844} "2880x2160"
9 = {Size@11845} "3264x1836"
10 = {Size@11846} "2160x2160"
11 = {Size@11847} "2560x1440"
12 = {Size@11848} "2224x1080"
13 = {Size@11849} "2048x1152"
14 = {Size@11850} "1920x1080"
15 = {Size@11851} "1440x1080"
16 = {Size@11852} "1088x1088"
17 = {Size@11853} "1280x720"
18 = {Size@11854} "1024x768"
19 = {Size@11855} "1056x704"
20 = {Size@11856} "960x720"
21 = {Size@11857} "960x540"
22 = {Size@11858} "720x720"
23 = {Size@11859} "800x450"
24 = {Size@11860} "720x480"
25 = {Size@11861} "640x480"
26 = {Size@11862} "352x288"
27 = {Size@11863} "320x240"
28 = {Size@11864} "256x144"
29 = {Size@11865} "176x144"
and we have 12 available sizes in this range
Camera2DeviceSurfaceManager.java:: getPreviewSize()
mCameraSupportedSurfaceCombinationMap.get(cameraId).getSurfaceDefinition().getPreviewSize() = "1920x1080"
cameraId=0
se...@gmail.com <se...@gmail.com> #4
The issue root cause is that CameraX will default filter out sizes smaller than 640x480. For Preview, the max size will be limited to under display size. I checked the HW spec info for the issue related devices. Display size of FUJITSU F-04J/F-05J is 360x640. That will result int that no size exists in the conditions that is larger or equal to 640x480 and smaller or equal to 360x640.
A temporary workaround for this situation is to use Preview.Builder#setTargetResolution() to set a size smaller than 640x480 to bypass the problem.
For device FUJITSU arrowsM04, I checked its HW spec info and its display size I found is 1280x720. It seems that the problem should not exist in the device.
Could you confirm that the problem exist on arrowsM04 device? What will be the returned value when using Display#getRealSize to obtain the display size?
ja...@deepl.com <ja...@deepl.com> #5
> A temporary workaround for this situation is to use Preview.Builder#setTargetResolution() to set a size smaller than 640x480 to bypass the problem.
OK. I will try it.
> Could you confirm that the problem exist on arrowsM04 device?
We receive the crash report (Crashlytics) that this crash has occurred on arrowsM04.
We don't have this device so we can't confirm that the problem really exist on arrowsM04.
> What will be the returned value when using Display#getRealSize to obtain the display size?
We can't investigate it for the same reason.
Thank you.
bl...@gmail.com <bl...@gmail.com> #6
This issue happened on devices that the display size is smaller than 640x480. In original auto-resolution mechanism, supported sizes smaller than 640x480 will be default filter out.
The auto-resolution mechanism encodes the guaranteed configurations tables in CameraDevice#createCaptureSession(SessionConfiguration). It defines that the PREVIEW size is the small one of the device display size and 1080p. The PREVIEW size will be the maximal size limitation for Preview use case. The reason it limits the size to display size and 1080p is the stream output in display size or 1080p has been able to provide good enough preview quality. Therefore, auto-resolution mechanism will limit the selected size to be smaller than the small one of the device display size and 1080p.
With above two conditions, in this issue, all sizes smaller than 640x480 have been filter out, therefore, there is no size smaller than the display size 320x240 can be selected to use. And cause the exception.
Solution:
When the display size is smaller than 640x480, auto-resolution mechanism won't filter out those small sizes smaller than 640x480. This makes those small size be left and can be selected for the Preview use case on small display devices.
The solution has been merged and will be included in next CameraX release.
[Deleted User] <[Deleted User]> #7
Hello.
This crash still occurs.
- CAMERAX VERSION: 1.0.0-beta4
- ANDROID OS BUILD NUMBER: Android 7.1.1
- DEVICE NAME: FUJITSU F-02H
We receive following crash report from FUJITSU F-02H. So far We have received this crash report only from F-02H.
java.lang.IllegalArgumentException
Can not get supported output size under supported maximum for the format: 34
androidx.camera.camera2.internal.SupportedSurfaceCombination.getSupportedOutputSizes (SupportedSurfaceCombination.java:349)
androidx.camera.camera2.internal.SupportedSurfaceCombination.getSuggestedResolutions (SupportedSurfaceCombination.java:197)
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.getSuggestedResolutions (Camera2DeviceSurfaceManager.java:198)
androidx.camera.core.CameraX.calculateSuggestedResolutions (CameraX.java:949)
androidx.camera.core.CameraX.bindToLifecycle (CameraX.java:351)
androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle (ProcessCameraProvider.java:230)
(our application's package name).CameraFragment.bindCameraUseCases (CameraFragment.java:174)
si...@google.com <si...@google.com> #8
Could you help to provide the following information to clarify the issue?
1. Is the full name of the device Fujitsu Arrows NX F-02H that has a 1440x2560 display?
2. Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
[Deleted User] <[Deleted User]> #9
- Is the full name of the device Fujitsu Arrows NX F-02H that has a 1440x2560 display?
Yes
- Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
Since we don't have this device, we'll try to collect this information in the next version of our app. The next version will be released later this month.
pi...@gmail.com <pi...@gmail.com> #10
Hello.
- Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
We have collected the output of the device where the crash occurs.
Device1
- Model : arrows Be F-05J
- Android Version : 7.1.1
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0: 480x480
CameraId 1: 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
Device2
- Model : Fujitsu arrows M04
- Android Version : 7.1.1
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0: 480x480
CameraId 1: 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
Additional Information
CameraX version : 1.0.0-beta04
We collect the supported output sizes by following code.
val errorString = buildString {
append("The supported output sizes of ImageFormat.PRIVATE: ")
(requireContext().getSystemService(Context.CAMERA_SERVICE) as CameraManager).apply {
cameraIdList.forEachIndexed { index, cameraId ->
val msg = if (VERSION.SDK_INT >= VERSION_CODES.M) {
val configurationMap =
getCameraCharacteristics(cameraId).get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)
val sizes = configurationMap?.getOutputSizes(ImageFormat.PRIVATE)
"CameraId $index: ${sizes?.joinToString(" ,")}"
} else {
"CameraId $index: This device version is under M."
}
append(msg)
}
}
}
th...@gmail.com <th...@gmail.com> #11
st...@google.com <st...@google.com> #12
I tried to find the device specs and both 720x1280
size display. For the camera id 0 device, it is a different case that the display size is larger than 640x480
but the device only supports a 480x480
size. The case also caused the same IllegalArgumentException and was also fixed by 1.0.0-beta04
release. Before 480x480
size would be filtered out and then caused the IllegalArgumentException. After it was merged, the 640x480
size threshold was removed and then the 480x480
size would be kept and selected to use.
It looks like 1.0.0-beta04
release had been used to collect the supported sizes information. But the issue should have been fixed by 1.0.0-beta04
release. Did you only check the device model name to collect the supported sizes information or collect the information when the IllegalArgumentException issue happens again?
CameraX's 1.0.0-beta04
version. Maybe you can also consider to upgrade to the latest 1.0.0-rc01
version for your application. Thanks.
[Deleted User] <[Deleted User]> #13
Did you only check the device model name to collect the supported sizes information or collect the information when the IllegalArgumentException issue happens again?
We collect informations only from the device on which IllegalArgumentException happened.
Our latest app uses CameraX version 1.0.0-beta10
and this issue still occurres.
However we don't receive crash report from Fujitsu arrows Be F-05J
or Fujitsu arrows M04
so far. (This doesn't mean this issue is fixed on these devices because our app is heavily rely on camera so these device's user wouldn't use our app anymore.)
Instead, we receive crash report from
- Model : Fujitsu F-03K
- Android Version : 7.1.2
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0 : 480x480
CameraId 1 : 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
[Deleted User] <[Deleted User]> #14
I missed some settings when I simulated the issue by robolectric test so that I was not able to reproduce it. Now, I can reproduce the issue if the device only supports one 480x480 resolution. I'm working on the solution and target to make it included in next release.
[Deleted User] <[Deleted User]> #15
Branch: androidx-main
commit 69d15dff7bb857ee33a0f643ff42a0f8bc475ab2
Author: charcoalchen <charcoalchen@google.com>
Date: Fri Jan 08 18:30:03 2021
Fixed IllegalArgumentException issue happened when all preview supported sizes are smaller than 640x480 and display size is larger than 640x480.
Do not filter out sizes smaller than 640x480 when all preview supported sizes are smaller than 640x480 and display size is larger than 640x480.
Relnote:"Fixed IllegalArgumentException issue happened when all preview supported sizes are smaller than 640x480 and display size is larger than 640x480."
Bug: 150506192
Test: SupportedSurfaceCombinationTest
Change-Id: I2a63ce8e2ad42a9cc060c8635ac3603bf440b1ec
M camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/SupportedSurfaceCombination.java
M camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/SupportedSurfaceCombinationTest.java
[Deleted User] <[Deleted User]> #16
ap...@google.com <ap...@google.com> #17
Branch: androidx-main
commit 2858b9e78538908fc3ce28ad346321fd014ae55b
Author: Zach Klippenstein <klippenstein@google.com>
Date: Fri Jul 15 18:49:53 2022
Validate the indices returned by OffsetMappings and throw better exceptions.
Instances of OffsetMapping are provided by developers when passing a
custom VisualTransformation to a text field. Those offset mappings must
correctly map indices between the original and transformed strings.
However, it is very easy to write a mapping that returns invalid indices
that are outside of the actual strings. When that happens, the text
internals eventually throw an exception, but it's not very helpful. This
change explicitly validates the returned values on every call, and if
they're invalid, throws an exception with a more detailed error message
that can hopefully help developers troubleshoot what's wrong.
The validation is performed by wrapping the OffsetMapping in one that
knows the lengths of the original and transformed text, and then using
that wrapper everywhere we perform the mapping.
This change adds UI tests that validate the detailed exception is being
thrown when interacting with cursor and selection in a text field that
has an invalid mapping.
Bug:
Test: ./gradlew :compose:f:f:test
Relnote: "Text fields will now throw more detailed exceptions when the
`OffsetMapping` provided by a `VisualTransformation` returns invalid
indices."
Change-Id: Ie73f9a652c29dde66d073a868a2e1c181feaa98d
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/api/current.txt
A compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/ValidatingOffsetMappingTest.kt
M compose/foundation/foundation/build.gradle
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldVisualTransformationSelectionBoundsTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManager.kt
A compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/ValidatingOffsetMapping.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldScroll.kt
al...@mercari.com <al...@mercari.com> #18
Can anyone confirm if this is fixed in 1.2.1?
[Deleted User] <[Deleted User]> #19
There is a major flaw in the VisualTransformation Logic. The visual transformation (along with offset mapping) can only work if the transformed text is larger or equal to the original text. The visual transformation fails in case the original text is larger than the transformed text. Below I am sharing Credit Card Example:
Original Text -> "1234-5678-9012-3456"
Transformed Text -> "1234567890123456"
Note: This is the exact reverse of the example given in the doc. Here we want the transformed text to be smaller than the original text.
Compose Version: 1.3.0-alpha03
Code:
class CredCardTransformation() : VisualTransformation {
override fun filter(text: AnnotatedString): TransformedText {
// Sending "1234567890123456" directly just to test
return TransformedText(AnnotatedString(text = "1234567890123456"), creditCardOffsetTranslator)
}
}
// Original example - just reversed the mappers.
val creditCardOffsetTranslator = object : OffsetMapping {
override fun transformedToOriginal(offset: Int): Int {
if (offset <= 3) return offset
if (offset <= 7) return offset + 1
if (offset <= 11) return offset + 2
if (offset <= 16) return offset + 3
return 19
}
override fun originalToTransformed(offset: Int): Int {
if (offset <= 4) return offset
if (offset <= 9) return offset - 1
if (offset <= 14) return offset - 2
if (offset <= 19) return offset - 3
return 16
}
}
/**
* UI Code
**/
val input = remember {
mutableStateOf("1234-5678-9012-3456") // Static Text
}
val textFieldValue = remember {
mutableStateOf(TextFieldValue(text = input.value))
}
BasicTextField(
value = textFieldValue.value,
onValueChange = {
textFieldValue.value = it
},
visualTransformation = CredCardTransformation(),
)
Given this code, if we try to select all the text. This code will fail immediately with a crash. Below is the stack trace of the error.
Process: com.example.myapplication, PID: 25958
java.lang.IllegalArgumentException: offset(18) is out of bounds [0, 16]
at androidx.compose.ui.text.MultiParagraph.requireIndexInRangeInclusiveEnd(MultiParagraph.kt:756)
at androidx.compose.ui.text.MultiParagraph.getCursorRect(MultiParagraph.kt:605)
at androidx.compose.ui.text.TextLayoutResult.getCursorRect(TextLayoutResult.kt:529)
at androidx.compose.foundation.text.selection.TextFieldSelectionManager.getContentRect(TextFieldSelectionManager.kt:727)
at androidx.compose.foundation.text.selection.TextFieldSelectionManager.showSelectionToolbar$foundation_release(TextFieldSelectionManager.kt:662)
at androidx.compose.foundation.text.CoreTextFieldKt.SelectionToolbarAndHandles(CoreTextField.kt:989)
at androidx.compose.foundation.text.CoreTextFieldKt.access$SelectionToolbarAndHandles(CoreTextField.kt:1)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1$1.invoke(CoreTextField.kt:614)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1$1.invoke(CoreTextField.kt:561)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.foundation.text.selection.SimpleLayoutKt.SimpleLayout(SimpleLayout.kt:79)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1.invoke(CoreTextField.kt:561)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1.invoke(CoreTextField.kt:540)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2363)
at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2653)
at androidx.compose.foundation.text.ComposableSingletons$BasicTextFieldKt$lambda-2$1.invoke(BasicTextField.kt:281)
at androidx.compose.foundation.text.ComposableSingletons$BasicTextFieldKt$lambda-2$1.invoke(BasicTextField.kt:281)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5.invoke(CoreTextField.kt:540)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5.invoke(CoreTextField.kt:539)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2363)
at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2653)
at androidx.compose.foundation.text.ContextMenu_androidKt.ContextMenuArea(ContextMenu.android.kt:29)
at androidx.compose.foundation.text.CoreTextFieldKt.CoreTextFieldRootBox(CoreTextField.kt:640)
at androidx.compose.foundation.text.CoreTextFieldKt.CoreTextField(CoreTextField.kt:539)
at androidx.compose.foundation.text.BasicTextFieldKt.BasicTextField(BasicTextField.kt:283)
at com.example.myapplication.ComposableSingletons$MainActivityKt$lambda-1$1$1$1$1.invoke(MainActivity.kt:40)
at com.example.myapplication.ComposableSingletons$MainActivityKt$lambda-1$1$1$1$1.invoke(MainActivity.kt:39)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2363)
E/AndroidRuntime: at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2630)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3227)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3205)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:336)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3205)
at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3170)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:748)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:876)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:107)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:485)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:454)
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:1184)
at android.view.Choreographer.doCallbacks(Choreographer.java:986)
at android.view.Choreographer.doFrame(Choreographer.java:907)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1171)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:334)
at android.app.ActivityThread.main(ActivityThread.java:8278)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@65f48d5, androidx.compose.ui.platform.MotionDurationScaleImpl@88118ea, StandaloneCoroutine{Cancelling}@38b17db, AndroidUiDispatcher@1e01278]
am...@gmail.com <am...@gmail.com> #20
ValidatingOffsetMapping seems to be broken. Having lots of runtime crashes:
IllegalStateException: OffsetMapping.transformedToOriginal returned invalid mapping: 7 -> 6 is not in range of original text [0, 0]
at androidx.compose.foundation.text.ValidatingOffsetMapping.transformedToOriginal(ValidatingOffsetMapping.kt:69)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.setCursorOffset-ULxng0E$foundation_release(TextFieldDelegate.kt:174)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke-k-4lQ0M(CoreTextField.kt:337)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke(CoreTextField.kt:332)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke-k-4lQ0M(TextFieldPressGestureFilter.kt:82)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke(TextFieldPressGestureFilter.kt:55)
at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1$1.invokeSuspend(TapGestureDetector.kt:234)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:566)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:456)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:469)
at androidx.compose.ui.node.BackwardsCompatNode.onPointerEvent-H0pRuoY(BackwardsCompatNode.kt:389)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:314)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:183)
at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:102)
at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:98)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1327)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1273)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1212)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:572)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1895)
at android.app.Activity.dispatchTouchEvent(Activity.java:4274)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:530)
at android.view.View.dispatchPointerEvent(View.java:15117)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6663)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6458)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5901)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5958)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5924)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6089)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5932)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6146)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5905)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5958)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5924)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5932)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5905)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8906)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8857)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8825)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9042)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:281)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:256)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:8988)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:9128)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1160)
at android.view.Choreographer.doCallbacks(Choreographer.java:950)
at android.view.Choreographer.doFrame(Choreographer.java:871)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1142)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8319)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@c0cda3d, androidx.compose.runtime.BroadcastFrameClock@425b232, StandaloneCoroutine{Cancelling}@5044b83, AndroidUiDispatcher@c284100]
Happens when empty field with transformed mask (XXX-XXX) looses focus and obtains it again.
Transformation code:
object ConfirmationCodeVisualTransformation : VisualTransformation {
override fun filter(text: AnnotatedString): TransformedText {
// XXX-XXX mask
val tLength = text.length
val noHyphen = tLength < 4 || text[3] != '-'
val transformed = if (noHyphen || tLength < 7) {
buildAnnotatedString {
append(text.subSequence(0, min(tLength, 3)))
val idx = if (noHyphen) 3 else 4
if (tLength > idx) {
append('-')
append(text.subSequence(idx, tLength))
}
if (length < 7) {
append("XXX-XXX".substring(length, 7))
}
}
} else {
text
}
return TransformedText(transformed, ConfirmationCodeOffsetMapping(!noHyphen))
}
}
private class ConfirmationCodeOffsetMapping(
private val hasHyphen: Boolean,
) : OffsetMapping {
override fun originalToTransformed(offset: Int): Int {
return when {
offset <= 2 || hasHyphen -> offset
offset <= 5 -> offset + 1
else -> 7
}
}
override fun transformedToOriginal(offset: Int): Int {
return when {
offset <= 3 || hasHyphen -> offset
offset <= 7 -> offset - 1
else -> 6
}
}
}
po...@gmail.com <po...@gmail.com> #21
java.lang.IllegalStateException: OffsetMapping.transformedToOriginal returned invalid mapping: 5 -> 1 is not in range of original text [0, 0]
at androidx.compose.foundation.text.ValidatingOffsetMapping.transformedToOriginal(ValidatingOffsetMapping.kt:69)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.setCursorOffset-ULxng0E$foundation_release(TextFieldDelegate.kt:174)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke-k-4lQ0M(CoreTextField.kt:337)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke(CoreTextField.kt:332)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke-k-4lQ0M(TextFieldPressGestureFilter.kt:82)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke(TextFieldPressGestureFilter.kt:55)
at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1$1.invokeSuspend(TapGestureDetector.kt:234)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:566)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:456)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:469)
at androidx.compose.ui.node.BackwardsCompatNode.onPointerEvent-H0pRuoY(BackwardsCompatNode.kt:389)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:314)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:183)
at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:102)
at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:98)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1327)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1273)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1212)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
E/AndroidRuntime: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:465)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1849)
at android.app.Activity.dispatchTouchEvent(Activity.java:4011)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:423)
at android.view.View.dispatchPointerEvent(View.java:14212)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5652)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5455)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4958)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5011)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4977)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5117)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4985)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5174)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4958)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5011)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4977)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4985)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4958)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7675)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7644)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7605)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7800)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:188)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:336)
at android.os.Looper.loop(Looper.java:174)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@8c5a481, androidx.compose.runtime.BroadcastFrameClock@10c8926, StandaloneCoroutine{Cancelling}@d842967, AndroidUiDispatcher@28d3314]
I/Process: Sending signal. PID: 25981 SIG: 9
Happens on compose foundation '1.3.0-alpha03' and later. I have to strictly stay on '1.3.0-alpha02'. It works fine
implementation('androidx.compose.foundation:foundation:1.3.0-beta01') { version { strictly '1.3.0-alpha02' } }
Crashes every time when i try to get focus
const val MAX_NUMBERS = 10
private const val PHONE_MASK = "+7 (___) ___-__-__"
val prefix = PHONE_MASK.substring(1, PHONE_MASK.indexOfFirst { it == ' ' })
private fun mobileNumberFilter(
text: AnnotatedString,
color: Color,
textStyle: TextStyle
): TransformedText {
val trimmed = if (text.text.length >= MAX_NUMBERS) text.text.take(MAX_NUMBERS) else text.text
val annotatedString = AnnotatedString.Builder().run {
pushStyle(getSpanStyle(color, textStyle))
append(PHONE_MASK.substring(0, prefix.length + 2))
for (i in trimmed.indices) {
if (i == 0) {
append('(')
}
append(trimmed[i])
if (i == 2) {
append(") ")
}
if (i == 5 || i == 7) {
append('-')
}
}
pushStyle(getSpanStyle(Color.LightGray, textStyle))
append(PHONE_MASK.takeLast(PHONE_MASK.length - length))
toAnnotatedString()
}
val phoneNumberOffsetTranslator = object : OffsetMapping {
override fun originalToTransformed(offset: Int): Int {
if (offset <= 3) return offset + 4
if (offset <= 6) return offset + 6
if (offset <= 8) return offset + 7
if (offset <= MAX_NUMBERS) return offset + 8
return PHONE_MASK.length
}
override fun transformedToOriginal(offset: Int): Int {
if (offset <= 4) return 0
if (offset <= 9) return offset - 4
if (offset <= 13) return offset - 6
if (offset <= 16) return offset - 7
if (offset <= 18) return offset - 8
return MAX_NUMBERS
}
}
return TransformedText(annotatedString, phoneNumberOffsetTranslator)
}
nf...@gmail.com <nf...@gmail.com> #22
Guys, I found that this crash for some reason is connected to the Stripe lib:
I mean, before I added that lib to the project - just in the build.gradle as dependency, that code worked, but after that - crashes 100%.
[Deleted User] <[Deleted User]> #23
any updates team google?
th...@gmail.com <th...@gmail.com> #24
hi...@gmail.com <hi...@gmail.com> #25
am...@gmail.com <am...@gmail.com> #26
Dear Googlers, please do something. Compose 1.3 is already in RC stage, but it has completely broken text VisualTransformation
/OffsetMapping
.
ValidatingOffsetMapping
broke it in 1.3.0-alpha03, it is completely unusable since then.
hm...@gmail.com <hm...@gmail.com> #27
com.google.android.material:material:1.6.1 & compose 1.2.1
dj...@gmail.com <dj...@gmail.com> #28
dj...@gmail.com <dj...@gmail.com> #29
am...@gmail.com <am...@gmail.com> #30
And at least since 1.4.0-alpha02
compose libs are binary incompatible with androidx-compose-foundation:1.3.0-alpha02
.
So strict version is no longer the option here without proper fix :(
ja...@gmail.com <ja...@gmail.com> #31
ap...@google.com <ap...@google.com> #32
Branch: androidx-main
commit 9ac08cafc1b343f1e77adc7eb76f065a99ddf967
Author: Halil Ozercan <halilibo@google.com>
Date: Thu Dec 01 04:15:33 2022
Use correct offsets for transformed and original states in TextField during selection and showing magnifier.
When showing selection toolbar, content rect area was being calculated by using the original offset of characters. This can cause unexpected errors, most probably out-of-range exceptions when a reduced visual transformation (shorter transformed text than the original) is applied.
While calculating the center for magnifier, transformed offset was coerced using the original value of TextField. This is now fixed and it uses transformedText length.
One small change is also made along the same lines to `TextPreparedSelection`. It used original selection.end while deciding on paragraph direction which again may cause IndexOutOfBounds exception. This raw offset is now transformed before being queried.
Test: ./gradle :compose:foundation:foundation:cAT
Bug:
Change-Id: I92b1612e4c8009defc7def58d4fd955c18165eae
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/selection/TextFieldVisualTransformationMagnifierTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldSelectionTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManager.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextPreparedSelection.kt
[Deleted User] <[Deleted User]> #33
se...@gmail.com <se...@gmail.com> #34
Seeing this issue with Compose 1.3.1
as well might be related
se...@gmail.com <se...@gmail.com> #35
Is there any good workaround while we wait for this to be fixed? I cannot consistently reproduce it either, but I have seen it a few times and it is very common in crashlytics
Seconding this - would love to have a workaround until the fix gets baked. This is affecting users in the wild 🙁
ra...@gmail.com <ra...@gmail.com> #36
Possible temporary workaround is to ensure that value returned in transformedToOriginal
is not greater than original text length. For my date field masked with DD-MM-YYYY
it seems to work fine.
class Date(private val mask: String = "DD-MM-YYYY") : VisualTransformation {
override fun filter(text: AnnotatedString): TransformedText {
val trimmed = text.text.let { if (it.length >= 8) it.substring(0..7) else it }
val annotatedString = AnnotatedString.Builder().apply {
for (i in trimmed.indices) {
append(trimmed[i])
if (i == 1 || i == 3) {
append("-")
}
}
append(mask.takeLast(mask.length - length))
}.toAnnotatedString()
val dateOffsetMapping = object : OffsetMapping {
override fun originalToTransformed(offset: Int): Int {
if (offset <= 1) return offset
if (offset <= 3) return offset + 1
if (offset <= 7) return offset + 2
return 10
}
override fun transformedToOriginal(offset: Int): Int {
return when {
offset <= 2 -> offset
offset <= 5 -> offset - 1
offset <= 9 -> offset - 2
else -> 8
}.coerceAtMost(text.length)
}
}
return TransformedText(annotatedString, dateOffsetMapping)
}
}
kl...@google.com <kl...@google.com> #37
The latest fix hasn't been released yet, it should be out in the next release, probably next week.
am...@gmail.com <am...@gmail.com> #38
Next week passed, any updates?
ha...@google.com <ha...@google.com> #39
The latest fix was part of 1.4.0-alpha04 release of foundation. Please give it a try. If your problem persists, please provide a minimal repro project.
Also make sure that you are upgrading foundation version, not just material module that pulls in foundation.
implementation("androidx.compose.foundation:foundation:1.4.0-alpha04") // or the latest alpha05
st...@google.com <st...@google.com>
am...@gmail.com <am...@gmail.com> #40
Not completely fixed in androidx.compose.foundation:foundation:1.4.0-alpha04
, 1.4.0-alpha05
, or 1.4.0-beta01
.
Now it's harder to catch it manually, but occasionally it happens. After release, we see a lot of crashes.
Just try to repeatedly write/remove/cut/paste something e.g. with ConfirmationCodeVisualTransformation
from my
Example stack trace:
java.lang.IllegalStateException: OffsetMapping.transformedToOriginal returned invalid mapping: 7 -> 6 is not in range of original text [0, 5]
at androidx.compose.foundation.text.ValidatingOffsetMapping.transformedToOriginal(ValidatingOffsetMapping.kt:69)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.setCursorOffset-ULxng0E$foundation_release(TextFieldDelegate.kt:225)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke-k-4lQ0M(CoreTextField.kt:341)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke(CoreTextField.kt:336)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke-k-4lQ0M(TextFieldPressGestureFilter.kt:82)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke(TextFieldPressGestureFilter.kt:55)
at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1.invokeSuspend(TapGestureDetector.kt:255)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:566)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:456)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:469)
at androidx.compose.ui.node.BackwardsCompatNode.onPointerEvent-H0pRuoY(BackwardsCompatNode.kt:370)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:314)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:183)
at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:102)
at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:98)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1343)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1289)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1228)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:572)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1895)
at android.app.Activity.dispatchTouchEvent(Activity.java:4274)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:530)
at android.view.View.dispatchPointerEvent(View.java:15117)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6663)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6458)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5901)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5958)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5924)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6089)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5932)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6146)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5905)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5958)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5924)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5932)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5905)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8906)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8857)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8825)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9042)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:281)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:340)
at android.os.Looper.loopOnce(Looper.java:168)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8319)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@24fd51, androidx.compose.runtime.BroadcastFrameClock@294b9b6, StandaloneCoroutine{Cancelling}@2acb6b7, AndroidUiDispatcher@bbfbe24]
an...@mamkin.dev <an...@mamkin.dev> #41
I have an outlinedtextfield with trailing and leading icon
it crashes on longclick on trailing or leading icon (only first time, if long click is not first action - the crash doesn't happen)
my project for reproduce is in attachements
19:21:56.681 E FATAL EXCEPTION: main
Process: dev.mamkin.composeviewmodel, PID: 6518
java.lang.IllegalArgumentException: offset(4) is out of bounds [0, 4)
at androidx.compose.ui.text.MultiParagraph.requireIndexInRange(MultiParagraph.kt:771)
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.selection.TextFieldSelectionManagerKt.calculateSelectionMagnifierCenterAndroid-O0kMr_c(TextFieldSelectionManager.kt:868)
at androidx.compose.foundation.text.selection.TextFieldSelectionManager_androidKt$textFieldMagnifier$1$1.invoke-F1C5BW0(TextFieldSelectionManager.android.kt:51)
at androidx.compose.foundation.text.selection.TextFieldSelectionManager_androidKt$textFieldMagnifier$1$1.invoke(TextFieldSelectionManager.android.kt:49)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.DerivedSnapshotState.currentRecord(DerivedState.kt:161)
at androidx.compose.runtime.DerivedSnapshotState.getDependencies(DerivedState.kt:236)
at androidx.compose.runtime.CompositionImpl.recordReadOf(Composition.kt:736)
at androidx.compose.runtime.Recomposer$readObserverOf$1.invoke(Recomposer.kt:1094)
at androidx.compose.runtime.Recomposer$readObserverOf$1.invoke(Recomposer.kt:1094)
at androidx.compose.runtime.DerivedSnapshotState.getValue(DerivedState.kt:221)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt.rememberAnimatedMagnifierPosition$lambda$1(SelectionMagnifier.kt:126)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt.access$rememberAnimatedMagnifierPosition$lambda$1(SelectionMagnifier.kt:1)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt.rememberAnimatedMagnifierPosition(SelectionMagnifier.kt:83)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt.access$rememberAnimatedMagnifierPosition(SelectionMagnifier.kt:1)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt$animatedSelectionMagnifier$1.invoke(SelectionMagnifier.kt:68)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt$animatedSelectionMagnifier$1.invoke(SelectionMagnifier.kt:67)
at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:265)
at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:260)
at androidx.compose.ui.Modifier$Element.foldIn(Modifier.kt:115)
at androidx.compose.ui.ComposedModifierKt.materialize(ComposedModifier.kt:260)
at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:266)
at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:260)
at androidx.compose.ui.Modifier$Element.foldIn(Modifier.kt:115)
at androidx.compose.ui.CombinedModifier.foldIn(Modifier.kt:301)
at androidx.compose.ui.CombinedModifier.foldIn(Modifier.kt:301)
at androidx.compose.ui.ComposedModifierKt.materialize(ComposedModifier.kt:260)
at androidx.compose.ui.layout.LayoutKt$materializerOf$1.invoke-Deg8D_g(Layout.kt:191)
at androidx.compose.ui.layout.LayoutKt$materializerOf$1.invoke(Layout.kt:190)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.foundation.text.selection.SimpleLayoutKt.SimpleLayout(SimpleLayout.kt:75)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1.invoke(CoreTextField.kt:590)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1.invoke(CoreTextField.kt:565)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:162)
19:21:56.681 E at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2465)
at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2756)
at androidx.compose.material3.OutlinedTextFieldKt.OutlinedTextFieldLayout(OutlinedTextField.kt:463)
at androidx.compose.material3.TextFieldImplKt$CommonDecorationBox$3.invoke-RIQooxk(TextFieldImpl.kt:206)
at androidx.compose.material3.TextFieldImplKt$CommonDecorationBox$3.invoke(TextFieldImpl.kt:113)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:179)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.material3.TextFieldTransitionScope.Transition-DTcfvLk(TextFieldImpl.kt:329)
at androidx.compose.material3.TextFieldImplKt.CommonDecorationBox(TextFieldImpl.kt:103)
at androidx.compose.material3.TextFieldDefaults.OutlinedTextFieldDecorationBox(TextFieldDefaults.kt:649)
at androidx.compose.material3.OutlinedTextFieldKt$OutlinedTextField$2$2.invoke(OutlinedTextField.kt:190)
at androidx.compose.material3.OutlinedTextFieldKt$OutlinedTextField$2$2.invoke(OutlinedTextField.kt:189)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5.invoke(CoreTextField.kt:565)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5.invoke(CoreTextField.kt:564)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:162)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2465)
at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2756)
at androidx.compose.foundation.text.ContextMenu_androidKt.ContextMenuArea(ContextMenu.android.kt:29)
at androidx.compose.foundation.text.CoreTextFieldKt.CoreTextFieldRootBox(CoreTextField.kt:670)
at androidx.compose.foundation.text.CoreTextFieldKt.CoreTextField(CoreTextField.kt:564)
at androidx.compose.foundation.text.BasicTextFieldKt.BasicTextField(BasicTextField.kt:161)
at androidx.compose.foundation.text.BasicTextFieldKt.BasicTextField(BasicTextField.kt:332)
at androidx.compose.material3.OutlinedTextFieldKt$OutlinedTextField$2.invoke(OutlinedTextField.kt:163)
at androidx.compose.material3.OutlinedTextFieldKt$OutlinedTextField$2.invoke(OutlinedTextField.kt:161)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.material3.OutlinedTextFieldKt.OutlinedTextField(OutlinedTextField.kt:161)
at dev.mamkin.composeviewmodel.TradingInputViewKt.TradingInputView(TradingInputView.kt:58)
at dev.mamkin.composeviewmodel.TradingInputViewKt$TradingInputView$6.invoke(Unknown Source:14)
at dev.mamkin.composeviewmodel.TradingInputViewKt$TradingInputView$6.invoke(Unknown Source:10)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:162)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2465)
at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2733)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3364)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3342)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3342)
al...@gmail.com <al...@gmail.com> #42
I'm running compose version: 1.4.2
java.lang.IllegalArgumentException: offset(4) is out of bounds [0, 3]
at androidx.compose.ui.text.MultiParagraph.requireIndexInRangeInclusiveEnd(MultiParagraph.kt:777)
at androidx.compose.ui.text.MultiParagraph.getCursorRect(MultiParagraph.kt:626)
at androidx.compose.ui.text.TextLayoutResult.getCursorRect(TextLayoutResult.kt:547)
at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.jumpByLinesOffset(TextPreparedSelection.kt:304)
at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.moveCursorUpByLine(TextPreparedSelection.kt:213)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:116)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:104)
at androidx.compose.foundation.text.TextFieldKeyInput.commandExecutionContext(TextFieldKeyInput.kt:224)
at androidx.compose.foundation.text.TextFieldKeyInput.process-ZmokQxo(TextFieldKeyInput.kt:104)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke-ZmokQxo(TextFieldKeyInput.kt:258)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke(TextFieldKeyInput.kt:258)
at androidx.compose.ui.input.key.KeyInputInputModifierNodeImpl.onKeyEvent-ZmokQxo(KeyInputModifierNode.kt:97)
at androidx.compose.ui.focus.FocusOwnerImpl.dispatchKeyEvent-ZmokQxo(FocusOwnerImpl.kt:180)
at androidx.compose.ui.platform.AndroidComposeView.sendKeyEvent-ZmokQxo(AndroidComposeView.android.kt:631)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:639)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:453)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1839)
at android.app.Activity.dispatchKeyEvent(Activity.java:3953)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:126)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:86)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:144)
at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:604)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:60)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3413)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:367)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5413)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5281)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4947)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5004)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4980)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:5141)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3064)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2607)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2598)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3041)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:143)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:336)
at android.os.Looper.loop(Looper.java:174)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
ca...@checkout-mo.caspeco.se <ca...@checkout-mo.caspeco.se> #43
kotlin version: 1.8.20
Stacktrace:
Fatal Exception: java.lang.IllegalArgumentException: offset(2) is out of bounds [0, 1]
at androidx.compose.ui.text.MultiParagraph.requireIndexInRangeInclusiveEnd(MultiParagraph.kt:777)
at androidx.compose.ui.text.MultiParagraph.getParagraphDirection(MultiParagraph.kt:573)
at androidx.compose.ui.text.TextLayoutResult.getParagraphDirection(TextLayoutResult.kt:500)
at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.isLtr(BaseTextPreparedSelection.java:254)
at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.moveCursorRight(BaseTextPreparedSelection.java:108)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2$2.invoke(TextFieldKeyInput.java:111)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2$2.invoke(TextFieldKeyInput.java:111)
at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.collapseRightOr(BaseTextPreparedSelection.java:137)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.java:111)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.java:104)
at androidx.compose.foundation.text.TextFieldKeyInput.commandExecutionContext(TextFieldKeyInput.java:224)
at androidx.compose.foundation.text.TextFieldKeyInput.process-ZmokQxo(TextFieldKeyInput.java:104)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke-ZmokQxo(TextFieldKeyInput.kt:258)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke(TextFieldKeyInput.kt:258)
at androidx.compose.ui.input.key.KeyInputInputModifierNodeImpl.onKeyEvent-ZmokQxo(KeyInputInputModifierNodeImpl.java:97)
at androidx.compose.ui.focus.FocusOwnerImpl.dispatchKeyEvent-ZmokQxo(FocusOwnerImpl.java:180)
at androidx.compose.ui.platform.AndroidComposeView.sendKeyEvent-ZmokQxo(AndroidComposeView.android.kt:631)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:639)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:453)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1839)
at android.app.Activity.dispatchKeyEvent(Activity.java:3953)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:86)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:144)
at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:604)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:60)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3413)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:367)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5413)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5281)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4947)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5004)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4980)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:5141)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3064)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2607)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2598)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3041)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:143)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:336)
at android.os.Looper.loop(Looper.java:174)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
ni...@bryo.fr <ni...@bryo.fr> #44
Compose 1.4.0
Kotlin 1.8.10
Stacktrace :
Fatal Exception: java.lang.IllegalArgumentException: lineIndex(-1) is out of bounds [0, 1)
at androidx.compose.ui.text.MultiParagraph.requireLineIndexInRange(MultiParagraph.kt:783)
at androidx.compose.ui.text.MultiParagraph.getLineTop(MultiParagraph.kt:681)
at androidx.compose.ui.text.TextLayoutResult.getLineTop(TextLayoutResult.kt:423)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegate.getLastVisibleOffset(MultiWidgetSelectionDelegate.kt:57)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegate.getLastVisibleOffset(MultiWidgetSelectionDelegate.kt:172)
at androidx.compose.foundation.text.TextController$drawTextAndSelectionBehind$1.invoke(CoreText.kt:422)
at androidx.compose.foundation.text.TextController$drawTextAndSelectionBehind$1.invoke(CoreText.kt:418)
at androidx.compose.ui.draw.DrawBackgroundModifier.draw(DrawModifier.kt:119)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:92)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:350)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:64)
at androidx.compose.foundation.BorderKt$drawRoundRectBorder$1.invoke(Border.kt:341)
at androidx.compose.foundation.BorderKt$drawRoundRectBorder$1.invoke(Border.kt:340)
at androidx.compose.ui.draw.CacheDrawNode.draw(DrawModifier.kt:210)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:92)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:350)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:64)
at androidx.compose.foundation.Background.draw(Background.kt:107)
at androidx.compose.ui.node.BackwardsCompatNode.draw(BackwardsCompatNode.kt:352)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:92)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:350)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:64)
at androidx.compose.foundation.Background.draw(Background.kt:107)
at androidx.compose.ui.node.BackwardsCompatNode.draw(BackwardsCompatNode.kt:352)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:92)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:350)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:64)
at androidx.compose.foundation.DrawOverscrollModifier.draw(AndroidOverscroll.kt:79)
at androidx.compose.ui.node.BackwardsCompatNode.draw(BackwardsCompatNode.kt:352)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:92)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:350)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:1046)
at android.view.View.draw(View.java:24409)
at android.view.View.updateDisplayListIfDirty(View.java:23267)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:777)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:783)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:881)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:5647)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5330)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4486)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:3116)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10885)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1301)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1309)
at android.view.Choreographer.doCallbacks(Choreographer.java:923)
at android.view.Choreographer.doFrame(Choreographer.java:852)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1283)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
ha...@google.com <ha...@google.com> #45
0
height, last visible offset calculation tries to look for line index -1
. I'm creating a separate issue to track.
lo...@gmail.com <lo...@gmail.com> #46
ha...@google.com <ha...@google.com> #47
They seem to be similar. At the time of writing my comment I didn't realize a separate issue already existed albeit the issue content was just a stacktrace that couldn't be identified.
There seems to be a regression that brought back the same error. Thanks for pointing it out.
ch...@gmail.com <ch...@gmail.com> #48
au...@gmail.com <au...@gmail.com> #49
kl...@google.com <kl...@google.com> #50
I can't reproduce this on the latest build. I think it's been fixed in 1.5 or 1.6.
te...@gmail.com <te...@gmail.com> #51
ma...@gmail.com <ma...@gmail.com> #52
Fatal Exception: java.lang.IllegalArgumentException: offset(22) is out of bounds [0, 22)
at androidx.compose.ui.text.MultiParagraph.requireIndexInRange(MultiParagraph.kt:831)
at androidx.compose.ui.text.MultiParagraph.fillBoundingBoxes-8ffj60Q(MultiParagraph.kt:543)
at androidx.compose.ui.text.input.CursorAnchorInfoBuilder_androidKt.addCharacterBounds(CursorAnchorInfoBuilder_android.kt:145)
at androidx.compose.ui.text.input.CursorAnchorInfoBuilder_androidKt.build(CursorAnchorInfoBuilder_android.kt:81)
at androidx.compose.ui.text.input.CursorAnchorInfoController.updateCursorAnchorInfo(CursorAnchorInfoController.android.kt:147)
at androidx.compose.ui.text.input.CursorAnchorInfoController.updateTextLayoutResult(CursorAnchorInfoController.android.kt:117)
at androidx.compose.ui.text.input.TextInputServiceAndroid.updateTextLayoutResult(TextInputServiceAndroid.android.kt:434)
at androidx.compose.ui.text.input.TextInputSession.updateTextLayoutResult(TextInputService.kt:215)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.updateTextLayoutResult$foundation_release(TextFieldDelegate.java:202)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$onPositionedModifier$1.invoke(CoreTextField.kt:438)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$onPositionedModifier$1.invoke(CoreTextField.kt:415)
at androidx.compose.ui.layout.OnGloballyPositionedNode.onGloballyPositioned(OnGloballyPositionedModifier.kt:78)
at androidx.compose.ui.node.LayoutNode.dispatchOnPositionedCallbacks$ui_release(LayoutNode.kt:1100)
at androidx.compose.ui.node.OnPositionedDispatcher.dispatchHierarchy(OnPositionedDispatcher.kt:72)
at androidx.compose.ui.node.OnPositionedDispatcher.dispatchHierarchy(OnPositionedDispatcher.kt:76)
at androidx.compose.ui.node.OnPositionedDispatcher.dispatchHierarchy(OnPositionedDispatcher.kt:76)
at androidx.compose.ui.node.OnPositionedDispatcher.dispatchHierarchy(OnPositionedDispatcher.kt:76)
at androidx.compose.ui.node.OnPositionedDispatcher.dispatch(OnPositionedDispatcher.kt:63)
at androidx.compose.ui.node.MeasureAndLayoutDelegate.dispatchOnPositionedCallbacks(MeasureAndLayoutDelegate.kt:653)
at androidx.compose.ui.platform.AndroidComposeView.updatePositionCacheAndDispatch(AndroidComposeView.android.kt:1121)
at androidx.compose.ui.platform.AndroidComposeView.onLayout(AndroidComposeView.android.kt:1095)
at android.view.View.layout(View.java:23868)
at android.view.ViewGroup.layout(ViewGroup.java:6483)
at androidx.compose.ui.platform.AbstractComposeView.internalOnLayout$ui_release(ComposeView.android.kt:322)
at androidx.compose.ui.platform.AbstractComposeView.onLayout(ComposeView.android.kt:313)
at android.view.View.layout(View.java:23868)
at android.view.ViewGroup.layout(ViewGroup.java:6483)
(...)
uj...@gmail.com <uj...@gmail.com> #53
This is still happening in compose BOM 2024.02.02 It happens only when using samsung keyboard & works fine when using gboard And also it happens when visual transformation is applied & dot (.) is added
cl...@google.com <cl...@google.com> #54
This has been re-reported by Meta as happening in 1.7-beta04. I have asked them to post an update here on what they are seeing so they can help identify the issue
se...@google.com <se...@google.com>
ha...@google.com <ha...@google.com> #55
Created
Description
If this is a bug in the library, we would appreciate if you could attach:
Stack Trace