Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Issue when closing in-app browser with exit confirmation webpage #1658

Closed
2 tasks done
vladimir-beloded opened this issue May 19, 2023 · 4 comments
Closed
2 tasks done
Labels
bug Something isn't working stale

Comments

@vladimir-beloded
Copy link

  • I have read the Getting Started section
  • I have already searched for the same problem

Environment

Technology Version
Flutter version 3.10.1
Plugin version 6.0.0-beta.23
Android version Tiramisu (API 33)
iOS version -
macOS version -
Xcode version -

Device information: Any Android device/emulator.

Description

When a website with the exit confirmation is opened in the in-app browser and the user closes the in-app browser, it throws an error and does not open any pages then.

Expected behavior:

When a user tries to close the in-app browser, it should wait for the user's answer on the exit confirmation dialog and only after that, close the in-app browser.

Current behavior:

When a user tries to close the in-app browser, it closes immediately and throws a WindowLeaked error.

Steps to reproduce

  1. Open the website with the exit confirmation in the in-app browser on Android.
  2. Close the in-app browser.
  3. Observe the error in the console.
  4. Try to open this website again.
  5. Observe that the in-app browser is stuck on the loading page.

Images

Screen.Recording.2023-05-19.at.10.41.43.mov

Stacktrace/Logcat

E/WindowManager( 5115): android.view.WindowLeaked: Activity com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserActivity has leaked window DecorView@e118b24[InAppBrowserActivity] that was originally added here
E/WindowManager( 5115): at android.view.ViewRootImpl.(ViewRootImpl.java:920)
E/WindowManager( 5115): at android.view.ViewRootImpl.(ViewRootImpl.java:908)
E/WindowManager( 5115): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:391)
E/WindowManager( 5115): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
E/WindowManager( 5115): at android.app.Dialog.show(Dialog.java:352)
E/WindowManager( 5115): at android.app.AlertDialog$Builder.show(AlertDialog.java:1131)
E/WindowManager( 5115): at android.webkit.JsDialogHelper.showDialog(JsDialogHelper.java:128)
E/WindowManager( 5115): at dF0.f(chromium-TrichromeWebViewGoogle6432.apk-stable-506007134:721)
E/WindowManager( 5115): at Ea.run(chromium-TrichromeWebViewGoogle6432.apk-stable-506007134:651)
E/WindowManager( 5115): at android.os.Handler.handleCallback(Handler.java:942)
E/WindowManager( 5115): at android.os.Handler.dispatchMessage(Handler.java:99)
E/WindowManager( 5115): at android.os.Looper.loopOnce(Looper.java:201)
E/WindowManager( 5115): at android.os.Looper.loop(Looper.java:288)
E/WindowManager( 5115): at android.app.ActivityThread.main(ActivityThread.java:7872)
E/WindowManager( 5115): at java.lang.reflect.Method.invoke(Native Method)
E/WindowManager( 5115): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/WindowManager( 5115): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

@vladimir-beloded vladimir-beloded added the bug Something isn't working label May 19, 2023
@github-actions
Copy link

👋 @vladimir-beloded

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!

@adminant
Copy link

Exactly same issue here, after closing InAppBrowser with page not allowing to loose changes, exception comes:

Activity com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserActivity has leaked window DecorView@8f92cd4[InAppBrowserActivity]
[...]

and subsequent runs of InAppBrowser end with empty page.
Any workaround?

Copy link

github-actions bot commented Oct 3, 2024

This issue is stale and has been automatically closed because it has been open for more than 365 days with no activity. Please reopen a new issue if you still have it.

@github-actions github-actions bot added the stale label Oct 3, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2024
Copy link

github-actions bot commented Nov 3, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants