I have a few flutter applications in production where the webview stopped working. webview_flutter fails to show the (soft) keyboard on Android 12 (API 31), no matter of what kind of input field is clicked. The error can be easily reproduced with the Android emulator when switching between Android 11 and 12. On Android 12 it fails with a exception like this:
[ ] 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.