flutter_inappwebview
flutter_inappwebview copied to clipboard
soft keyboard issue in Android 12 Devices
Couldn't open soft keyboard on Android 12 devices, but it's perfectly works on rest of all devices
👋 @AkhilSajiCodzoc
NOTE: This comment is auto-generated.
Are you sure you have already searched for the same problem?
Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!
If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.
In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE]
or ios WKWebView [MY ERROR HERE]
keywords.
Following these steps can save you, me, and other people a lot of time, thanks!
Salme issue found on Android 12
Set useHybridComposition
property to true
useHybridComposition is set to true, works fine in all Android versions except Android 12. It sends: W/InputMethodManager: Ignoring showSoftInput() as view=com.pichillilorenzo.flutter_inappwebview.in_app_webview.InAppWebView{1bc916 VFEDHVCL. .F...... 0,0-1440,2425} is not served. V/InputMethodManager: b/117267690: Display ID mismatch found. ViewRootImpl displayId=4 InputMethodManager displayId=0. Use the right InputMethodManager instance to avoid performance overhead. java.lang.Throwable at android.view.inputmethod.InputMethodManager.getFallbackInputMethodManagerIfNecessary(InputMethodManager.java:549) at android.view.inputmethod.InputMethodManager.restartInput(InputMethodManager.java:1843) at org.chromium.content.browser.input.ImeAdapterImpl.H(chromium-TrichromeWebViewGoogle6432.apk-stable-447211487:4) at org.chromium.content.browser.input.ImeAdapterImpl.updateState(chromium-TrichromeWebViewGoogle6432.apk-stable-447211487:30) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loopOnce(Looper.java:161) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7839) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) 2022-02-07 12:00:10.056 8076-8076/im.ea.simplyfive V/InputMethodManager: b/117267690: Display ID mismatch found. ViewRootImpl displayId=4 InputMethodManager displayId=0. Use the right InputMethodManager instance to avoid performance overhead. java.lang.Throwable at android.view.inputmethod.InputMethodManager.getFallbackInputMethodManagerIfNecessary(InputMethodManager.java:549) at android.view.inputmethod.InputMethodManager.showSoftInput(InputMethodManager.java:1625) at android.view.inputmethod.InputMethodManager.showSoftInput(InputMethodManager.java:1617) at sH.d(chromium-TrichromeWebViewGoogle6432.apk-stable-447211487:3) at org.chromium.content.browser.input.ImeAdapterImpl.L(chromium-TrichromeWebViewGoogle6432.apk-stable-447211487:20) at org.chromium.content.browser.input.ImeAdapterImpl.updateState(chromium-TrichromeWebViewGoogle6432.apk-stable-447211487:32) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loopOnce(Looper.java:161) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7839) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Ok, I was using setOptions to set useHybridComposition, it does not work there, it must be set only in InAppWebView creation. I added there and is now working.
Awesome, its working!
@EnriqueMx can you share a sample code where you have added it? I'm having the same issue
Ok, I was using setOptions to set useHybridComposition, it does not work there, it must be set only in InAppWebView creation. I added there and is now working.
InAppWebView( key: webViewKey, initialOptions: InAppWebViewGroupOptions( crossPlatform: InAppWebViewOptions( mediaPlaybackRequiresUserGesture: false, ), android: AndroidInAppWebViewOptions( useHybridComposition: true, ), ios: IOSInAppWebViewOptions( allowsInlineMediaPlayback: true, )), ..... )
Ok, I was using setOptions to set useHybridComposition, it does not work there, it must be set only in InAppWebView creation. I added there and is now working.
InAppWebView( key: webViewKey, initialOptions: InAppWebViewGroupOptions( crossPlatform: InAppWebViewOptions( mediaPlaybackRequiresUserGesture: false, ), android: AndroidInAppWebViewOptions( useHybridComposition: true, ), ios: IOSInAppWebViewOptions( allowsInlineMediaPlayback: true, )), ..... )
Thank you very much. This works.. 💯
Does it work properly in Android 13? I have set it to not take effect