..
解决 chromecast 4k 不出现虚拟键盘的问题
今天测试 app 的时候发现 chromecast 在输入的时候没有办法调用系统的虚拟键盘。我还以为只是触发了某个小 bug,关机重启应该就能解决。尝试之后发现没有效果。然后发现系统有更新,那更新一下总能解决了吧?升级到最新版之后问题依旧。
后使用 adb 查看 log,发现系统输入相关的 app 有报错。
09-14 17:28:29.730 14462 14462 E AndroidRuntime: FATAL EXCEPTION: main
09-14 17:28:29.730 14462 14462 E AndroidRuntime: Process: com.google.android.inputmethod.latin, PID: 14462
09-14 17:28:29.730 14462 14462 E AndroidRuntime: java.lang.RuntimeException: Unable to create service com.android.inputmethod.latin.LatinIME: android.view.InflateException: Binary XML file line #63 in com.google.android.inputmethod.latin:layout/floating_keyboard_holder: Binary XML file line #63 in com.google.android.inputmethod.latin:layout/floating_keyboard_holder: Error inflating class android.widget.ImageView
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.app.ActivityThread.handleCreateService(ActivityThread.java:4500)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.app.ActivityThread.access$1700(ActivityThread.java:247)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2072)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7839)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #63 in com.google.android.inputmethod.latin:layout/floating_keyboard_holder: Binary XML file line #63 in com.google.android.inputmethod.latin:layout/floating_keyboard_holder: Error inflating class android.widget.ImageView
09-14 17:28:29.730 14462 14462 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #63 in com.google.android.inputmethod.latin:layout/floating_keyboard_holder: Error inflating class android.widget.ImageView
09-14 17:28:29.730 14462 14462 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at java.lang.reflect.Constructor.newInstance0(Native Method)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:858)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:780)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.view.LayoutInflater.onCreateView(LayoutInflater.java:934)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.view.LayoutInflater.onCreateView(LayoutInflater.java:954)
09-14 17:28:29.730 14462 14462 E AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1008)
随即通过系统设置,找到一个名叫 GBoard 的系统 app,然后清除它的数据,即可解决此类问题。
怀疑可能是配置文件有损坏导致了这个 app 异常。但这类问题也不好复现,以后留意观察看看。