Status Update
Comments
ji...@gmail.com <ji...@gmail.com> #2
W ActivityManager: Unable to start service Intent { cmp=<pkgname>/androidx.room.MultiInstanceInvalidationService } U=0: not found
Because room never checks for bindService results (I assume it returns false), MultiInstanceInvalidationClient is never put into effect when room database is built when in lockdown.
ji...@gmail.com <ji...@gmail.com> #4
le...@gmail.com <le...@gmail.com> #5
Como arreglar errores
st...@premex.se <st...@premex.se> #6
Fatal Exception: java.lang.IllegalArgumentException: end cannot negative. [end: -1]
at androidx.compose.ui.text.TextRangeKt.packWithCheck(TextRangeKt.java:124)
at androidx.compose.ui.text.TextRangeKt.TextRange(TextRangeKt.java:37)
at androidx.compose.ui.text.input.EditingBuffer.delete$ui_text_release(EditingBuffer.kt:190)
at androidx.compose.ui.text.input.DeleteSurroundingTextCommand.applyTo(EditCommand.kt:271)
at androidx.compose.ui.text.input.EditProcessor.apply(EditProcessor.kt:93)
at androidx.compose.foundation.text.TextFieldKeyInput.apply(TextFieldKeyInput.kt:62)
at androidx.compose.foundation.text.TextFieldKeyInput.access$apply(TextFieldKeyInput.java:49)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:134)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:102)
at androidx.compose.foundation.text.TextFieldKeyInput.commandExecutionContext(TextFieldKeyInput.java:211)
at androidx.compose.foundation.text.TextFieldKeyInput.process-ZmokQxo(TextFieldKeyInput.java:102)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke-ZmokQxo(TextFieldKeyInput.kt:243)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke(TextFieldKeyInput.kt:243)
at androidx.compose.ui.node.ModifiedKeyInputNode.propagateKeyEvent-ZmokQxo(ModifiedKeyInputNode.kt:47)
at androidx.compose.ui.input.key.KeyInputModifier.processKeyInput-ZmokQxo(KeyInputModifier.java:78)
at androidx.compose.ui.platform.AndroidComposeView.sendKeyEvent-ZmokQxo(AndroidComposeView.android.kt:563)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:570)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2395)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1727)
at androidx.core.view.KeyEventDispatcher.activitySuperDispatchKeyEventPre28(KeyEventDispatcher.java:130)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:87)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:599)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3090)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2310)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4127)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4089)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3787)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3844)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3820)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3981)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2253)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1874)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1865)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2230)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
[Deleted User] <[Deleted User]> #7
This is happening to me also and its incredibly annoying! Del button on samsung android tablet keyboard will just crash everything.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.dealermade.next.photostudio, PID: 9116
java.lang.IllegalArgumentException: end cannot negative. [end: -1]
at androidx.compose.ui.text.TextRangeKt.packWithCheck(TextRange.kt:124)
at androidx.compose.ui.text.TextRangeKt.TextRange(TextRange.kt:37)
at androidx.compose.ui.text.input.EditingBuffer.delete$ui_text_release(EditingBuffer.kt:205)
at androidx.compose.ui.text.input.DeleteSurroundingTextCommand.applyTo(EditCommand.kt:271)
at androidx.compose.ui.text.input.EditProcessor.apply(EditProcessor.kt:110)
at androidx.compose.foundation.text.TextFieldKeyInput.apply(TextFieldKeyInput.kt:62)
at androidx.compose.foundation.text.TextFieldKeyInput.access$apply(TextFieldKeyInput.kt:49)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:134)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:102)
at androidx.compose.foundation.text.TextFieldKeyInput.commandExecutionContext(TextFieldKeyInput.kt:211)
at androidx.compose.foundation.text.TextFieldKeyInput.process-ZmokQxo(TextFieldKeyInput.kt:102)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke-ZmokQxo(TextFieldKeyInput.kt:243)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke(TextFieldKeyInput.kt:243)
at androidx.compose.ui.node.ModifiedKeyInputNode.propagateKeyEvent-ZmokQxo(ModifiedKeyInputNode.kt:47)
at androidx.compose.ui.input.key.KeyInputModifier.processKeyInput-ZmokQxo(KeyInputModifier.kt:78)
at androidx.compose.ui.platform.AndroidComposeView.sendKeyEvent-ZmokQxo(AndroidComposeView.android.kt:562)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:569)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1986)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1986)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1986)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1986)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:903)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1947)
at android.app.Activity.dispatchKeyEvent(Activity.java:4142)
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 io.sentry.android.core.internal.gestures.WindowCallbackAdapter.dispatchKeyEvent(WindowCallbackAdapter.java:29)
at io.sentry.android.core.internal.gestures.SentryWindowCallback.dispatchKeyEvent(SentryWindowCallback.java:13)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:758)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:7365)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7191)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6595)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6652)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6618)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6786)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6626)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6843)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6599)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6652)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6618)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6626)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6599)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:9880)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:9718)
E/AndroidRuntime: at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:9671)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:6206)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8653)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.6.10'
ext.apollo_version = '2.5.11'
ext.jetpack_compose_version = '1.2.0-alpha04'
ext.coil_version = "1.3.2"
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
classpath "io.realm:realm-gradle-plugin:10.8.0"
// https://docs.mongodb.com/realm/sdk/android/quick-start-local/
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files, unless of course it is a build plugin, like realm or kotlin :)
}
}
allprojects {
repositories {
google()
maven { url "https://jitpack.io" }
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
plugins {
id 'com.android.application'
id 'kotlin-android'
id("com.apollographql.apollo").version("$apollo_version")
id "io.sentry.android.gradle" version "3.0.0-beta.2"
}
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'
configurations.all {
resolutionStrategy.force "org.antlr:antlr4-runtime:4.9.2"
resolutionStrategy.force "org.antlr:antlr4-tool:4.9.2"
}
sentry {
// Enables or disables the automatic upload of mapping files
// during a build. If you disable this, you'll need to manually
// upload the mapping files with sentry-cli when you do a release.
// Default is enabled.
autoUpload = true
// Disables or enables the automatic configuration of Native Symbols
// for Sentry. This executes sentry-cli automatically so
// you don't need to do it manually.
// Default is disabled.
uploadNativeSymbols = true
// Does or doesn't include the source code of native code for Sentry.
// This executes sentry-cli with the --include-sources param. automatically so
// you don't need to do it manually.
// Default is disabled.
includeNativeSources = true
// Enable or disable the tracing instrumentation.
// Does auto instrumentation for 'androidx.sqlite' and 'androidx.room' libraries.
// It starts and finishes a Span within any CRUD operation.
// Default is enabled.
// Only available v3.0.0 and above.
tracingInstrumentation {
enabled = true
}
}
android {
signingConfigs {
}
compileSdk 32
buildToolsVersion '32.0.0'
defaultConfig {
minSdkVersion 29
targetSdkVersion 31
versionCode 1
versionName "1.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
signingConfig signingConfigs.release
shrinkResources = true
minifyEnabled = true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
versionNameSuffix 'debug'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
useIR = true
}
buildFeatures {
viewBinding true
compose true
}
composeOptions {
kotlinCompilerExtensionVersion jetpack_compose_version
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
apollo {
generateKotlinModels.set(true)
}
dependencies {
implementation("androidx.compose.compiler:compiler:$jetpack_compose_version")
implementation 'com.google.android.gms:play-services-cronet:18.0.1'
implementation("io.coil-kt:coil:$coil_version")
implementation("io.coil-kt:coil-compose:$coil_version")
// https://github.com/coil-kt/coil or using jetpack https://coil-kt.github.io/coil/compose/
implementation 'com.google.android.play:core-ktx:1.8.1'
implementation 'androidx.paging:paging-common-ktx:3.1.0'
implementation 'com.google.accompanist:accompanist-insets:0.24.3-alpha'
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
//https://square.github.io/leakcanary/fundamentals-how-leakcanary-works/
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'id.zelory:compressor:3.0.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0-native-mt'
implementation 'androidx.core:core-ktx:1.9.0-alpha01'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.1'
implementation "androidx.compose.ui:ui-tooling-preview:$jetpack_compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
implementation "androidx.datastore:datastore:1.0.0"
implementation "androidx.datastore:datastore-preferences:1.0.0"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation('androidx.paging:paging-runtime-ktx:3.1.0')
implementation('androidx.paging:paging-compose:1.0.0-alpha14')
//jetpack added
implementation('androidx.activity:activity-compose:1.4.0')
implementation("androidx.compose.ui:ui:$jetpack_compose_version")
// Tooling support (Previews, etc.)
implementation("androidx.compose.ui:ui-tooling:$jetpack_compose_version")
// Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
implementation("androidx.compose.foundation:foundation:$jetpack_compose_version")
// Material Design
implementation("androidx.compose.material:material:$jetpack_compose_version")
// Material design icons
implementation("androidx.compose.material:material-icons-core:$jetpack_compose_version")
implementation("androidx.compose.material:material-icons-extended:$jetpack_compose_version")
implementation("androidx.compose.material:material-ripple:$jetpack_compose_version")
// Integration with observables
implementation("androidx.compose.runtime:runtime-livedata:$jetpack_compose_version")
implementation("androidx.compose.runtime:runtime-rxjava2:$jetpack_compose_version")
implementation 'com.google.mlkit:barcode-scanning:17.0.2'
def camerax_version = '1.1.0-beta02'
def camera_view = '1.1.0-beta02'
// CameraX core library using camera2 implementation
implementation "androidx.camera:camera-core:$camerax_version"
implementation "androidx.camera:camera-camera2:$camerax_version"
// CameraX Lifecycle Library
implementation "androidx.camera:camera-lifecycle:$camerax_version"
// CameraX View class
implementation "androidx.camera:camera-view:$camera_view"
// If you want to additionally use the CameraX Extensions library
implementation("androidx.camera:camera-extensions:$camera_view")
//apollo added
implementation("com.apollographql.apollo:apollo-runtime:$apollo_version")
// optional: for coroutines support
implementation("com.apollographql.apollo:apollo-coroutines-support:$apollo_version")
// optional: Most of apollo-android does not depend on Android in practice and runs on any JVM or on Kotlin native. apollo-android-support contains a few Android-only helper classes. For an example to send logs to logcat or run callbacks on the main thread.
implementation("com.apollographql.apollo:apollo-android-support:$apollo_version")
implementation 'com.github.javafaker:javafaker:1.0.2'
implementation 'io.sentry:sentry-android:6.0.0-alpha.2'
implementation 'io.intercom.android:intercom-sdk:10.6.2'
implementation 'com.google.accompanist:accompanist-permissions:0.20.0'
// Compose tooling
implementation 'androidx.compose.ui:ui-tooling:1.2.0-alpha04'
// Compose Constraint layout
implementation 'androidx.constraintlayout:constraintlayout-compose:1.0.0'
// re-orderable lazyColumn
implementation('org.burnoutcrew.composereorderable:reorderable:0.7.4')
// Placeholder UI
implementation('com.google.accompanist:accompanist-placeholder:0.19.0')
// Adding Gson
implementation('com.google.code.gson:gson:2.9.0')
// J2mod
implementation('com.ghgande:j2mod:3.1.1')
// Google nearby api
implementation('com.google.android.gms:play-services-nearby:18.0.2')
// UI Tests
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$jetpack_compose_version")
}
se...@google.com <se...@google.com> #8
Thank you for the details!
lo...@gmail.com <lo...@gmail.com> #9
I get the exact same error from the play console testing. In my case, it is caused on a Nexus 5X. I even did a check before, but it still occurs regularly and I don't understand why. The original code was take from
I am using version 1.2.0-alpha04 for all compose dependencies.
My implementation:
val start = newText.length
val end = newText.length
if (start <= 0 || end <= 0) {
Log.debug { "START OR END NEGATIVE: start $start, end $end, value $this, newString $newString" }
return this
}
val newSelection = TextRange(
start = start,
end = end
)
The crash log:
java.lang.IllegalArgumentException: end cannot negative. [end: -1]
at androidx.compose.ui.text.TextRangeKt.packWithCheck(TextRange.kt:124)
at androidx.compose.ui.text.TextRangeKt.TextRange(TextRange.kt:37)
at androidx.compose.ui.text.input.EditingBuffer.delete$ui_text_release(EditingBuffer.kt:205)
at androidx.compose.ui.text.input.DeleteSurroundingTextCommand.applyTo(EditCommand.kt:271)
at androidx.compose.ui.text.input.EditProcessor.apply(EditProcessor.kt:110)
at androidx.compose.foundation.text.TextFieldKeyInput.apply(TextFieldKeyInput.kt:62)
at androidx.compose.foundation.text.TextFieldKeyInput.access$apply(TextFieldKeyInput.kt:49)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:134)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:102)
at androidx.compose.foundation.text.TextFieldKeyInput.commandExecutionContext(TextFieldKeyInput.kt:211)
at androidx.compose.foundation.text.TextFieldKeyInput.process-ZmokQxo(TextFieldKeyInput.kt:102)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke-ZmokQxo(TextFieldKeyInput.kt:243)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke(TextFieldKeyInput.kt:243)
at androidx.compose.ui.node.ModifiedKeyInputNode.propagateKeyEvent-ZmokQxo(ModifiedKeyInputNode.kt:47)
at androidx.compose.ui.input.key.KeyInputModifier.processKeyInput-ZmokQxo(KeyInputModifier.kt:78)
at androidx.compose.ui.platform.AndroidComposeView.sendKeyEvent-ZmokQxo(AndroidComposeView.android.kt:562)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:569)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2395)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1727)
at androidx.core.view.KeyEventDispatcher.activitySuperDispatchKeyEventPre28(KeyEventDispatcher.java:136)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:89)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:142)
at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:599)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3090)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2310)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4127)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4089)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3787)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3844)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3820)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3981)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2253)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1874)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1865)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2230)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
lo...@gmail.com <lo...@gmail.com> #10
This bug is still present in 1.2.0-alpha06.
er...@gmail.com <er...@gmail.com> #11
im...@gmail.com <im...@gmail.com> #12
an...@gmail.com <an...@gmail.com> #13
For Samsung devices
ma...@gmail.com <ma...@gmail.com> #14
st...@gmail.com <st...@gmail.com> #15
We're experiencing this exact crash in production with a stacktrace that does not help us reproduce it locally at all since the stacktrace doesn't mention any of our code at all. But the worst part is that we're explicitly setting the foundation version to 1.1.1, but looking at our transitive dependencies we're pulling the 1.2.0-beta01 which if all the previous testimonies here are to be believed has to be the culprit.
As a temp fix we're thinking of depending strictly
in gradle on foundation 1.1.1. I am not sure if I am misunderstanding something, but if the case is as I am explaining it, how can we avoid such problems in the future?
st...@hedvig.com <st...@hedvig.com> #16
This may be interesting to you too
mx...@gmail.com <mx...@gmail.com> #17
It seems that
I'm also getting this crash in Compose 1.2.0-beta01.
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.java:134)
From KeyCommand.DELETE_NEXT_CHAR
is received, so I came up with the following repro:
import android.view.KeyEvent
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performClick
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class TextFieldTest {
@get:Rule
val rule = createComposeRule()
@Test
fun textFieldCrash() {
rule.setContent {
var text by remember { mutableStateOf("Text") }
BasicTextField(
value = text,
onValueChange = { text = it },
modifier = Modifier.testTag("TextField")
)
}
rule.onNodeWithTag("TextField").performClick()
rule.waitForIdle()
InstrumentationRegistry.getInstrumentation().sendKeyDownUpSync(KeyEvent.KEYCODE_FORWARD_DEL)
}
}
kl...@google.com <kl...@google.com> #18
Reproduced via adb, since I don't have a keyboard with a
adb shell input keyevent 112
Happens whenever the cursor is at the end of the text, even if there's text in the field.
ap...@google.com <ap...@google.com> #19
Branch: androidx-main
commit d782bbdc9e6e64066eb69ab5ea94640ebbfc534c
Author: Zach Klippenstein <klippenstein@google.com>
Date: Sun May 22 09:55:03 2022
Noop when FORWARD_DELETE keycode is sent to the end of a text field.
When a hardware keyboard's forward delete key is pressed (typically
called "delete", not "backspace"), `TextFieldKeyInput` searches for the
next character from the cursor and creates an `EditCommand` to delete
it. This also happens for some software keyboards that have a delete
key, such as Samsung's.
We were not handling the case where the `BreakIterator`'s search for the
next character returns a sentinel indicating the end of the string,
which turned into a negative index and caused the crash.
The fix is to explicitly no-op when no character break is found.
However, the whole bug is not fixed, because the only place I could find
where we manually create an `EditCommand` for this creates a
`DeleteSurroundingTextCommand` and the bug report includes stack traces
for `DeleteSurroundingTextInCodePointsCommand` as well. The only way
such a command is created is if the `InputConnection` is sent one, and I
can't figure out how to trigger that yet.
This change also makes the commands in question throw at init when
passed invalid constructor arguments. While this is technically a
behavior change, this behavior was already broken before and it is
unlikely any external code is instantiating these objects.
Bug:
Test: Manually tested on emulator with adb to simulate keycode, and
on a Samsung tablet/soft keyboard.
Test: Added automated test: ./gradlew :compose:f:f:cDAT
Relnote: "Pressing the forward delete key when the cursor is at the end
of a text field will no longer crash."
Relnote: "`DeleteSurroundingTextCommand` and
`DeleteSurroundingTextInCodePointsCommand` now require their
constructor arguments to be non-negative."
Change-Id: Ica8e66d221137a82ac8aaa59372decab096a6ef6
M compose/ui/ui-text/build.gradle
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextPreparedSelection.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/StringHelpers.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/input/DeleteSurroundingTextCommandTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/EditCommand.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/HardwareKeyboardTest.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/input/DeleteSurroundingTextInCodePointsCommandTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldKeyInput.kt
[Deleted User] <[Deleted User]> #20
de...@gmail.com <de...@gmail.com> #21
az...@gmail.com <az...@gmail.com> #22
You can use onPreviewKeyEvent
to stop the propagation of events that would lead to a crash.
I've added something like this on app using
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.KeyEvent
import androidx.compose.ui.input.key.isAltPressed
import androidx.compose.ui.input.key.isCtrlPressed
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.onPreviewKeyEvent
import androidx.compose.ui.text.input.TextFieldValue
val osProperty: String = System.getProperty("os.name", "unknown")
val isMac = osProperty.startsWith("mac", ignoreCase = true)
@Composable
fun Modifier.applyTextFieldFixes(value: TextFieldValue): Modifier {
return onPreviewKeyEvent { event ->
// Returns true to mark the event as handled and stop its propagation.
when {
// Temporary fix for https://github.com/JetBrains/compose-jb/issues/565.
// To repro, press CTRL/Option+backspace on an empty TextField.
event.isCtrlBackspace() && value.text.isEmpty() -> true
// Temporary fix for https://github.com/JetBrains/compose-jb/issues/2023.
// To repro, simply press the DEL key at the end of the text.
event.key == Key.Delete && value.isCursorAtTheEnd() -> true
else -> false
}
}
}
private fun KeyEvent.isCtrlBackspace() = key == Key.Backspace && (isCtrlPressed || (isMac && isAltPressed))
private fun TextFieldValue.isCursorAtTheEnd(): Boolean {
val hasNoSelection = selection.collapsed
val isCursorAtTheEnd = text.length == selection.end
return hasNoSelection && isCursorAtTheEnd
}
// Usage
OutlinedTextField(
modifier = Modifier.applyTextFieldFixes(yourTextFieldValue),
value = yourTextFieldValue,
[...]
)
sh...@gmail.com <sh...@gmail.com> #23
kl...@google.com <kl...@google.com> #24
1.2.0-beta02 came out before the fix for this was merged. It should be in the latest RC, if not beta03.
kl...@google.com <kl...@google.com>
ha...@gmail.com <ha...@gmail.com> #26
st...@gmail.com <st...@gmail.com> #27
Are you sure you're on a version which has the fix? Which version is it that crashes for you?
ni...@gmail.com <ni...@gmail.com> #28
[Deleted User] <[Deleted User]> #29
sk...@gmail.com <sk...@gmail.com> #30
This is still happening as of Compose 1.4.0. Can't reproduce, but I got this happening in production today for a Galaxy Note 20 Ultra 5G.
im...@gmail.com <im...@gmail.com> #31
compose version : 1.4.3
kotlin_version = '1.8.10'
os: Android 12
device: SM-A125F
device.family: SM-A125F
handled:no
level: fatal
mechanism: UncaughtExceptionHandler
------------------------------------------------------
ava.lang.IllegalArgumentException: end cannot be negative. [start: 76, end: -1]
at androidx.compose.ui.text.TextRangeKt.packWithCheck(TextRange.kt:124)
at androidx.compose.ui.text.TextRangeKt.TextRange(TextRange.kt:37)
at androidx.compose.foundation.text.selection.SelectionAdjustmentKt.ensureAtLeastOneChar(SelectionAdjustment.kt:467)
at androidx.compose.foundation.text.selection.SelectionAdjustment$Companion$CharacterWithWordAccelerate$1.adjust-ZXO7KMw(SelectionAdjustment.kt:210)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegateKt.getTextSelectionInfo-yM0VcXU(MultiWidgetSelectionDelegate.kt:222)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegate.updateSelection-qCDeeow(MultiWidgetSelectionDelegate.kt:94)
at androidx.compose.foundation.text.selection.SelectionManager.updateSelection-3R_-tFg$foundation_release(SelectionManager.kt:755)
at androidx.compose.foundation.text.selection.SelectionManager.updateSelection-RHHTvR4$foundation_release(SelectionManager.kt:710)
at androidx.compose.foundation.text.selection.SelectionManager$handleDragObserver$1.onDrag-k-4lQ0M(SelectionManager.kt:597)
at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesWithObserver$5.invoke-Uv8p0NA(LongPressTextDragObserver.kt:117)
at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesWithObserver$5.invoke(LongPressTextDragObserver.kt:114)
at androidx.compose.foundation.gestures.DragGestureDetectorKt$detectDragGestures$5.invokeSuspend(DragGestureDetector.kt:191)
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:374)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:314)
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:1361)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1307)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1246)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
at android.view.View.dispatchPointerEvent(View.java:15335)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:7815)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7588)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6922)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6979)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6945)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:7143)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6953)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:7200)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6926)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6979)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6945)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6953)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6926)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:10400)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:10248)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:10204)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:10532)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(InputEventReceiver.java)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:239)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:10480)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:10621)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1108)
at android.view.Choreographer.doCallbacks(Choreographer.java:866)
at android.view.Choreographer.doFrame(Choreographer.java:789)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1092)
at android.os.Handler.handleCallback(Handler.java:938)
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:8663)
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:1135)
bl...@gmail.com <bl...@gmail.com> #32
Still happens all the time in a SelectionContainer
hierarchy over a column. Crashes the app. You'd think this bug should have priority.
androidx.compose:compose-bom:2023.08.00
androidx.compose.material3:material3:material3:1.1.1
androidx.compose.compiler:compiler:1.5.1
java.lang.IllegalArgumentException: start cannot be negative. [start: -1, end: 6]
at androidx.compose.ui.text.TextRangeKt.packWithCheck(TextRange.kt:121)
at androidx.compose.ui.text.TextRangeKt.TextRange(TextRange.kt:37)
at androidx.compose.foundation.text.selection.SelectionAdjustmentKt.ensureAtLeastOneChar(SelectionAdjustment.kt:462)
at androidx.compose.foundation.text.selection.SelectionAdjustment$Companion$CharacterWithWordAccelerate$1.adjust-ZXO7KMw(SelectionAdjustment.kt:210)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegateKt.getTextSelectionInfo-yM0VcXU(MultiWidgetSelectionDelegate.kt:222)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegate.updateSelection-qCDeeow(MultiWidgetSelectionDelegate.kt:94)
at androidx.compose.foundation.text.selection.SelectionManager.updateSelection-3R_-tFg$foundation_release(SelectionManager.kt:755)
at androidx.compose.foundation.text.selection.SelectionManager.updateSelection-RHHTvR4$foundation_release(SelectionManager.kt:710)
at androidx.compose.foundation.text.selection.SelectionManager$handleDragObserver$1.onDrag-k-4lQ0M(SelectionManager.kt:597)
at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesWithObserver$5.invoke-Uv8p0NA(LongPressTextDragObserver.kt:118)
at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesWithObserver$5.invoke(LongPressTextDragObserver.kt:115)
at androidx.compose.foundation.gestures.DragGestureDetectorKt$detectDragGestures$5$2.invoke(DragGestureDetector.kt:194)
at androidx.compose.foundation.gestures.DragGestureDetectorKt$detectDragGestures$5$2.invoke(DragGestureDetector.kt:193)
at androidx.compose.foundation.gestures.DragGestureDetectorKt.drag-jO51t88(DragGestureDetector.kt:115)
at androidx.compose.foundation.gestures.DragGestureDetectorKt$drag$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:179)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:168)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:474)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:508)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:497)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:368)
at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:665)
at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl.dispatchPointerEvent(SuspendingPointerInputFilter.kt:544)
at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:566)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:317)
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:96)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1446)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1398)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1338)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.View.dispatchPointerEvent(View.java:14858)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6446)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6247)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5725)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5913)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5970)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8696)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8647)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8616)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8819)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:239)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:8776)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:8905)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1037)
at android.view.Choreographer.doCallbacks(Choreographer.java:845)
at android.view.Choreographer.doFrame(Choreographer.java:772)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@23a716e, androidx.compose.runtime.BroadcastFrameClock@a86000f, StandaloneCoroutine{Cancelling}@9acc89c, AndroidUiDispatcher@85922a5]
gr...@google.com <gr...@google.com> #33
see
Description
Android Studio Build:30
Kotlin version:1.5.21
Steps to Reproduce:
1. when the textField is empty, cilck backSpace, then crash
Process: com.example.compose.jetchat, PID: 20258
java.lang.IllegalArgumentException: start cannot be negative. [start: -1]
at androidx.compose.ui.text.TextRangeKt.packWithCheck(TextRange.kt:121)
at androidx.compose.ui.text.TextRangeKt.TextRange(TextRange.kt:37)
at androidx.compose.ui.text.input.EditingBuffer.delete$ui_text_release(EditingBuffer.kt:190)
at androidx.compose.ui.text.input.DeleteSurroundingTextInCodePointsCommand.applyTo(EditCommand.kt:354)
at androidx.compose.ui.text.input.EditProcessor.apply(EditProcessor.kt:93)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.onEditCommand(TextFieldDelegate.kt:198)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.access$onEditCommand(TextFieldDelegate.kt:90)
at androidx.compose.foundation.text.TextFieldDelegate$Companion$restartInput$1.invoke(TextFieldDelegate.kt:246)
at androidx.compose.foundation.text.TextFieldDelegate$Companion$restartInput$1.invoke(TextFieldDelegate.kt:246)
at androidx.compose.ui.text.input.TextInputServiceAndroid$createInputConnection$1.onEditCommands(TextInputServiceAndroid.android.kt:111)
at androidx.compose.ui.text.input.RecordingInputConnection.endBatchEditInternal(RecordingInputConnection.android.kt:162)
at androidx.compose.ui.text.input.RecordingInputConnection.addEditCommandWithBatch(RecordingInputConnection.android.kt:136)
at androidx.compose.ui.text.input.RecordingInputConnection.deleteSurroundingTextInCodePoints(RecordingInputConnection.android.kt:202)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:464)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:85)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)