【发布时间】:2022-01-09 16:48:33
【问题描述】:
我有一些 webview 停止工作的 Flutter 应用程序。 webview_flutter 无法在 Android 12 (API 31) 上显示(软)键盘,无论单击哪种输入字段。在 Android 11 和 12 之间切换时,可以使用 Android 模拟器轻松重现该错误。在 Android 12 上,它会失败,并出现如下异常:
[ ] V/InputMethodManager(10400): b/117267690: Display ID mismatch found. ViewRootImpl displayId=1 InputMethodManager displayId=0. Use the right InputMethodManager instance to avoid performance overhead.
[ ] V/InputMethodManager(10400): java.lang.Throwable
[ ] V/InputMethodManager(10400): at android.view.inputmethod.InputMethodManager.getFallbackInputMethodManagerIfNecessary(InputMethodManager.java:549)
[ ] V/InputMethodManager(10400): at android.view.inputmethod.InputMethodManager.restartInput(InputMethodManager.java:1843)
[ ] V/InputMethodManager(10400): at org.chromium.content.browser.input.ImeAdapterImpl.H(chromium-TrichromeWebViewGoogle6432.apk-stable-447211487:4)
[ ] V/InputMethodManager(10400): at org.chromium.content.browser.input.ImeAdapterImpl.updateState(chromium-TrichromeWebViewGoogle6432.apk-stable-447211487:30)
[ ] V/InputMethodManager(10400): at android.os.MessageQueue.nativePollOnce(Native Method)
[ ] V/InputMethodManager(10400): at android.os.MessageQueue.next(MessageQueue.java:335)
[ ] V/InputMethodManager(10400): at android.os.Looper.loopOnce(Looper.java:161)
[ ] V/InputMethodManager(10400): at android.os.Looper.loop(Looper.java:288)
[ ] V/InputMethodManager(10400): at android.app.ActivityThread.main(ActivityThread.java:7842)
[ ] V/InputMethodManager(10400): at java.lang.reflect.Method.invoke(Native Method)
[ ] V/InputMethodManager(10400): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
[ ] V/InputMethodManager(10400): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
[ ] V/InputMethodManager(10400): b/117267690: Display ID mismatch found. ViewRootImpl displayId=1 InputMethodManager displayId=0. Use the right InputMethodManager instance to avoid performance overhead.
[ ] V/InputMethodManager(10400): java.lang.Throwable
[ ] V/InputMethodManager(10400): at android.view.inputmethod.InputMethodManager.getFallbackInputMethodManagerIfNecessary(InputMethodManager.java:549)
[ ] V/InputMethodManager(10400): at android.view.inputmethod.InputMethodManager.showSoftInput(InputMethodManager.java:1625)
[ ] V/InputMethodManager(10400): at android.view.inputmethod.InputMethodManager.showSoftInput(InputMethodManager.java:1617)
[ ] V/InputMethodManager(10400): at sH.d(chromium-TrichromeWebViewGoogle6432.apk-stable-447211487:3)
[ ] V/InputMethodManager(10400): at org.chromium.content.browser.input.ImeAdapterImpl.L(chromium-TrichromeWebViewGoogle6432.apk-stable-447211487:20)
[ ] V/InputMethodManager(10400): at org.chromium.content.browser.input.ImeAdapterImpl.updateState(chromium-TrichromeWebViewGoogle6432.apk-stable-447211487:32)
[ ] V/InputMethodManager(10400): at android.os.MessageQueue.nativePollOnce(Native Method)
[ ] V/InputMethodManager(10400): at android.os.MessageQueue.next(MessageQueue.java:335)
[ ] V/InputMethodManager(10400): at android.os.Looper.loopOnce(Looper.java:161)
[ ] V/InputMethodManager(10400): at android.os.Looper.loop(Looper.java:288)
[ ] V/InputMethodManager(10400): at android.app.ActivityThread.main(ActivityThread.java:7842)
[ ] V/InputMethodManager(10400): at java.lang.reflect.Method.invoke(Native Method)
[ ] V/InputMethodManager(10400): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
[ ] V/InputMethodManager(10400): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
[ ] W/InputMethodManager(10400): Ignoring showSoftInput() as view=com.pichillilorenzo.flutter_inappwebview.in_app_webview.InAppWebView{c5bb4f2 VFEDHVCL. .F...... 0,0-1080,1911} is not served.
【问题讨论】:
标签: android flutter webview android-12