flutter_inappwebview
flutter_inappwebview copied to clipboard
[Android 12] Ignoring showSoftInput() as view=com.pichillilorenzo.flutter_inappwebview... is not served
- [y] I have read the Get Started - Installation section
- [y] I have read and done the Get Started - Setup Android section
- [y] I have read and done the Get Started - Setup iOS section
- [y] I have already searched for the same problem
Environment
Technology | Version |
---|---|
Flutter version | 2.5.2 |
Plugin version | v 5.3.2 |
Android version | 12 |
iOS version | |
Xcode version |
Device information:
Description
On Pixel 4A with Android 12 the webview fails to trigger keyboard openings and this message is displayed in the console.
Ignoring showSoftInput() as view=com.pichillilorenzo.flutter_inappwebview.in_app_webview.InAppWebView{49c9195 VFEDHVCL. .F...... 0,0-1080,1838} is not served.
Expected behavior: The keyboard should be opened when the user taps on a webview form.
Current behavior:
As above.
Steps to reproduce
- This
- Than that
- Then
Images
Stacktrace/Logcat
V/InputMethodManager(18257): b/117267690: Display ID mismatch found. ViewRootImpl displayId=78 InputMethodManager displayId=0. Use the right InputMethodManager instance to avoid performance overhead. V/InputMethodManager(18257): java.lang.Throwable V/InputMethodManager(18257): at android.view.inputmethod.InputMethodManager.getFallbackInputMethodManagerIfNecessary(InputMethodManager.java:549) V/InputMethodManager(18257): at android.view.inputmethod.InputMethodManager.showSoftInput(InputMethodManager.java:1625) V/InputMethodManager(18257): at android.view.inputmethod.InputMethodManager.showSoftInput(InputMethodManager.java:1617) V/InputMethodManager(18257): at gK.d(chromium-TrichromeWebViewGoogle.aab-stable-460608533:3) V/InputMethodManager(18257): at org.chromium.content.browser.input.ImeAdapterImpl.v(chromium-TrichromeWebViewGoogle.aab-stable-460608533:20) V/InputMethodManager(18257): at org.chromium.content.browser.input.ImeAdapterImpl.updateState(chromium-TrichromeWebViewGoogle.aab-stable-460608533:32) V/InputMethodManager(18257): at android.os.MessageQueue.nativePollOnce(Native Method) V/InputMethodManager(18257): at android.os.MessageQueue.next(MessageQueue.java:335) V/InputMethodManager(18257): at android.os.Looper.loopOnce(Looper.java:161) V/InputMethodManager(18257): at android.os.Looper.loop(Looper.java:288) V/InputMethodManager(18257): at android.app.ActivityThread.main(ActivityThread.java:7842) V/InputMethodManager(18257): at java.lang.reflect.Method.invoke(Native Method) V/InputMethodManager(18257): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) V/InputMethodManager(18257): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) W/InputMethodManager(18257): Ignoring showSoftInput() as view=com.pichillilorenzo.flutter_inappwebview.in_app_webview.InAppWebView{49c9195 VFEDHVCL. .F...... 0,0-1080,1838} is not served.
👋 @lo-re-co
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!
I'm experiencing the same issue (with the same stack trace) in Android 12.
I don't know if it is related, but I'm also seeing a JS error at around the same time:
Ignored attempt to cancel a touchstart event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.
Facing the same issue. Did anyone manage to fix this?
Enabling hybrid composition seems to be a workaround to fix the keyboard issue:
InAppWebView(
initialOptions: InAppWebViewGroupOptions(
android: AndroidInAppWebViewOptions(
useHybridComposition: true
)
)
)
I imagine this is still going to be an issue with hybrid composition: https://github.com/flutter/flutter/issues/86157
Flutter 2.8.1 Still same issue
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-arm, locale ko-KR)
• Flutter version 3.0.2 at /Users/wogus/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cd41fdd495 (4 weeks ago), 2022-06-08 09:52:13 -0700
• Engine revision f15f824b57
• Dart version 2.17.3
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
• Android SDK at /Users/wogus/Library/Android/sdk
• Platform android-33, build-tools 33.0.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] IntelliJ IDEA Community Edition (version 2021.3.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.68.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.44.0
[✓] Connected device (3 available)
• LM G900N (mobile) • LMG900Nc1eda018 • android-arm64 • Android 12 (API 31)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.4 21F79 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.53
[✓] HTTP Host Availability
• All required HTTP hosts are available
Still same issue
When the app enters and exits the background once, the soft keyboard operates from then on.
any update?
有解决吗 目前在android13同样出现了这个问题 使用混合集成并没有解决
I call popup with EditText
// Call popup
PopupWindow popupWindow = new PopupWindow(
view,
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT,
true
);
popupWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
So with focusable false
its return the same error.
I changed it to true
, and it start work, but shows badly. Its was magical been fixed after add parameter
android:scrollbars="vertical"
to EditText.
Hope somebody like me will spend less time with this bag)