Crash due to NPE from WindowCallbackWrapper.dispatchTouchEvent
Stack trace
Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'boolean android.view.ViewGroup.getTouchscreenBlocksFocus()' on a null object reference
____________________
com.datadog.android.rum.internal.instrumentation.gestures.WindowCallbackWrapper.dispatchTouchEvent (WindowCallbackWrapper.kt:69)
___________________
Reproduction steps
Can't reproduce, can only notice on Crashlytics and Google Play Console
Volume
2%
Affected SDK versions
2.10.1
Latest working SDK version
I implemented 2.10.1 at first til now
Does the crash manifest in the latest SDK version?
Yes
Kotlin / Java version
2.0.10
Gradle / AGP version
8.6.0
Other dependencies versions
composeBom = "2024.12.01"
Device Information
No response
Other relevant information
I'm using JetpackCompose for my app. Due to FirebaseCrashlytics, the crash occur at a screen that has a LazyColum, a TextField. When scroll the lazy column, I called softwareKeyboardController?.hide() to hide the soft keyboard. Don't know does it cause the crash or not
Hi @DawnNguyenAhiho ,
this is an issue we've heard about in the past. In theory, the event passed into the Window.Callback.dispatchTouchEvent(MotionEvent event) method is supposed to be non null, and most of the time it is. But sometimes (and unfortunately we don't know why), a null value is passed from the Touch manager, in the Android Framework.
The line of code that appears in the callstack comes from our WindowCallbackWrapper, which uses the event to capture use interaction, and then forwards it to the original Window callback.
So even though it does appear in the callstack, it actually doesn't cause the crash. The root cause is something that somehow sends a null event to the window wrapper. Do the errors you get from Crashlytics show you a specific OS version or Device for this crash?
Hi @xgouchet, thank for your reply. According to Google Play Console Crash report, this is the report of crash by Device and OS Version. Hope this will help
Hello @DawnNguyenAhiho!
Can you please provide a full stacktrace if the issue still occurs?
@0xnm After deeper investigation, look like it is the issue from the LazyColumn duplicate key, and then some how datadog throw it, so that Play Console log that the issue is from data dog, but actually the root cause is the LazyColumn from Jetpack Compose, and now look like it does not occur anymore