Closed billdizl closed 2 years ago
小伙子,从堆栈的信息来看,我认为这个报错是系统 Bug 的可能性大一点,你是怎么看出来是 BaseActivity 的问题?判断的依据是什么?
首先这个按键事件是 WindowCallbackWrapper 触发的,中间经过了 BaseActivity 类,再到 Activity.dispatchKeyEvent,如果只拿这个证明是 BaseActivity 的问题有点说不过去吧?
还有 issue 模板上面不是写了?不处理没有复现步骤的 Bug,假设你无法复现,我也无法复现,怎么定位到具体的问题原因?退一万步来讲,就算强制修复了这个问题又该怎么验证?你想过这些问题了没?
超过一个星期没有响应,自动关闭此 issue。
【警告:请务必按照 issue 模板填写,不要抱有侥幸心理,一旦发现 issue 没有按照模板认真填写,一律直接关闭】
问题描述
框架版本【必填】:13.2
问题描述【必填】:Fatal Exception: java.lang.IllegalStateException: focus search returned a view that wasn't able to take focus! at android.widget.TextView.onKeyUp(TextView.java:8864) at android.view.KeyEvent.dispatch(KeyEvent.java:3383) at android.view.View.dispatchKeyEvent(View.java:13329) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:685) at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1869) at android.app.Activity.dispatchKeyEvent(Activity.java:3447) at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122) at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84) at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140) at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:599) at com.chiquedoll.chiquedoll.view.activity.BaseActivity.dispatchKeyEvent(BaseActivity.java:654) at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59) at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3089) at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:563) at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6035) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5890) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5343) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5396) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5362) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5521) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5370) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5578) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5343) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5396) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5362) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5370) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5343) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8405) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8338) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8291) at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:4980) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7073) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
复现步骤【必填】:未知
是否必现【必填】:否
出现问题的手机信息【必填】:品牌:samsung 型号:Galaxy S8+
出现问题的安卓版本【必填】:Android 9
请回答
是部分机型还是所有机型都会出现【必答】:未知
AndroidProject 最新的版本是否存在这个问题【必答】:是
是否已经查阅框架文档还未能解决的【必答】:是
issue 是否有人曾提过类似的问题【必答】:否
是否可以通过 AndroidProject 工程来复现该问题【必答】:否
使用原生的权限 API 是否会出现该问题【必答】:是 注: 出错误来自于BaseActivity中的dispatchKeyEvent 方法