flutter_inappwebview icon indicating copy to clipboard operation
flutter_inappwebview copied to clipboard

soft keyboard issue in Android 12 Devices

Open AkhilSajiCodzoc opened this issue 2 years ago • 9 comments

Couldn't open soft keyboard on Android 12 devices, but it's perfectly works on rest of all devices

AkhilSajiCodzoc avatar Feb 03 '22 13:02 AkhilSajiCodzoc

👋 @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!

github-actions[bot] avatar Feb 03 '22 13:02 github-actions[bot]

Salme issue found on Android 12

EnriqueMx avatar Feb 06 '22 16:02 EnriqueMx

Set useHybridComposition property to true

ljwdeveloper avatar Feb 07 '22 01:02 ljwdeveloper

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)

EnriqueMx avatar Feb 07 '22 19:02 EnriqueMx

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.

EnriqueMx avatar Feb 07 '22 19:02 EnriqueMx

Awesome, its working!

dhavaljani1990 avatar Feb 15 '22 13:02 dhavaljani1990

@EnriqueMx can you share a sample code where you have added it? I'm having the same issue

Nooshey avatar Mar 01 '22 12:03 Nooshey

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, )), ..... )

EnriqueMx avatar Mar 02 '22 17:03 EnriqueMx

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.. 💯

jananiDP avatar Aug 03 '22 06:08 jananiDP

Does it work properly in Android 13? I have set it to not take effect

forgetW avatar Aug 04 '23 07:08 forgetW