Status Update
Comments
ju...@google.com <ju...@google.com> #3
The fix you linked was for
The NullPointerException
seems to occur min
field on textFieldValue.selection
. It shouldn't be possible for TextFieldValue#selection
al...@airbnb.com <al...@airbnb.com> #4
Any updates on what might be causing this or if a safeguard could be added as part of a hotfix? This is now one of our top crashes, and we don't have much insight into why it's happening. We've updated to Compose 1.6.7 but are still seeing the crash.
al...@airbnb.com <al...@airbnb.com> #5
We're only seeing this on Android 14 (API 34).
se...@google.com <se...@google.com> #6
Cat 1 / P2 because it's a no workaround regression.
kl...@google.com <kl...@google.com> #7
Looks like the textFieldValue
getting passed to that method is !!
cast to non-null just before calling. Is it possible that a release build or minification could remove that null check, and textFieldValue
is getting passed as null?
kl...@google.com <kl...@google.com> #8
al...@gmail.com <al...@gmail.com> #9
I faced with this problem too
FATAL EXCEPTION: main
Process: com.example.musicplayer, PID: 15471
java.lang.NullPointerException
at androidx.compose.ui.text.input.CursorAnchorInfoController.updateCursorAnchorInfo(CursorAnchorInfoController.android.kt:150)
at androidx.compose.ui.text.input.CursorAnchorInfoController.updateTextLayoutResult(CursorAnchorInfoController.android.kt:119)
at androidx.compose.ui.text.input.TextInputServiceAndroid.updateTextLayoutResult(TextInputServiceAndroid.android.kt:434)
at androidx.compose.ui.text.input.TextInputSession.updateTextLayoutResult(TextInputService.kt:215)
The problem occurs when I enter something in OutlinedTextField, put the device in sleep mode(power button) and then wake it up. Then the application crashes. Not each time, but pretty often
al...@gmail.com <al...@gmail.com> #10
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MyApplicationTheme {
Surface(modifier = Modifier.fillMaxSize()) {
Greeting(
name = "Android",
modifier = Modifier
)
}
}
}
}
}
@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
val text = remember { mutableStateOf("") }
Column(modifier = modifier.fillMaxSize(), verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally) {
OutlinedTextField(value = text.value, onValueChange = { text.value = it })
Text(
text = "Hello $name!",
modifier = modifier
)
}
}
and here the problem occurs. I tried to use different versions of compose from 1.5.1 to 1.9.1
It's can be reproduced if I repeately block the phone and unblock it. I tried on two phones. Huawei P20 Pro and Xiaomi 13T Pro. The problem occurs only on Xiaomi phone. On Huawei I could not reproduce it.
se...@google.com <se...@google.com> #11
Thanks for the repro note!
ju...@google.com <ju...@google.com> #12
The fix aosp/3287096 for
Description
We started seeing this crash after updating to Compose 1.6.1 (stack trace is partially obfuscated):