使用鼠标滚动时 Compose 应用程序崩溃

问题描述 投票:0回答:1

所以我时不时地在桌面上使用我自己的 Android 应用程序,每当我在应用程序中的任何位置滚动鼠标时 - 无论是否可滚动,它都会崩溃

java.lang.IllegalStateException:ACTION_HOVER_EXIT 事件未清除。

这似乎是崩溃的根本原因

/**
 * If an [ACTION_HOVER_EXIT] event is received, it could be because an [ACTION_DOWN] is coming
 * from a mouse or stylus. We can't know for certain until the next event is sent. This message
 * is posted after receiving the [ACTION_HOVER_EXIT] to send the event if nothing else is
 * received before that.
 */
private val sendHoverExitEvent = Runnable {
    hoverExitReceived = false
    val lastEvent = previousMotionEvent!!
    check(lastEvent.actionMasked == ACTION_HOVER_EXIT) {
        "The ACTION_HOVER_EXIT event was not cleared."
    }
    sendMotionEvent(lastEvent)
}

https://androidx.tech/artifacts/compose.ui/ui/1.4.0-alpha03-source/androidx/compose/ui/platform/AndroidComposeView.android.kt.html

我没有显式声明

dispatchHoverEvent
,也没有显式声明
dispatchTouchEvent
,其中使用上面声明的 Runnable。

我正在寻找任何解决方案,无论是临时的还是非临时的。有关崩溃的更多信息,我很好奇它是否发生在其他人身上,如果是的话,这可能是某个库版本的问题?

更新我的依赖项如下:

androidx.compose:compose-bom:2023.10.01
androidx.activity:activity-compose:1.8.1
androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2
androidx.compose.foundation:foundation:1.5.4
androidx.hilt:hilt-navigation-compose:1.1.0
androidx.navigation:navigation-compose:2.7.5
com.google.dagger:hilt-compiler:2.46.1
com.google.dagger:hilt-android:2.48
android kotlin android-jetpack-compose
1个回答
0
投票

请查看 Google 问题跟踪器。目前有两个未解决的问题描述了您遇到的崩溃:

问题#314269723
问题#304219563

这两期都已分配,第一期最近也有一些活动。您可能需要为这些问题加注星标,以便向 Google 团队表明此问题与更多人相关。

© www.soinside.com 2019 - 2024. All rights reserved.