pichillilorenzo / flutter_inappwebview

A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
https://inappwebview.dev
Apache License 2.0
3.13k stars 1.44k forks source link

Render process (11786)'s crash wasn't handled by all associated webviews, triggering application crash. #1325

Open huangsir0 opened 1 year ago

huangsir0 commented 1 year ago

Environment

Technology Version
Flutter version 3.3.0
Plugin version 5.4.3+7
Android version Android 10,level 29
iOS version
Xcode version

Stacktrace/Logcat

09-19 14:04:50.994 12140 12140 F chromium: [FATAL:crashpad_client_linux.cc(561)] Render process (17621)'s crash wasn't handled by all associated webviews, triggering application crash.

Possible Cause

https://www.jianshu.com/p/29a8dce65634

github-actions[bot] commented 1 year ago

👋 @huangsir0

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!

DevWiz96 commented 1 year ago

I'm having the exact same problem! Been stuck with for a week, is there any solution ?

androideveloper commented 1 year ago

onRenderProcessGone method should be implemented by all webviews in the app, otherwise once webview process crashes, it will crash the app https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)

pakeng commented 1 year ago

@huangsir0 Are you have any solution?

royston-c commented 1 year ago

@androideveloper Thanks for the hint on the onRenderProcessGone override.

I have implemented this method via androidOnRenderProcessGone in this plugin (on v5, I think it has changed in v6). Where I try to recreate the InAppWebView via a new Key.

However, I still see crashes with the error: [FATAL:crashpad_client_linux.cc(732)] Render process (2370)'s crash wasn't handled by all associated webviews, triggering application crash. in the Play Console.

Example implementation:

    String inAppWebViewKeyString = Uuid().v4().toString();
    Uri? currentUri; // tracked via the controller

    final webview = InAppWebView(
      key: Key(inAppWebViewKeyString),
      initialUrlRequest: URLRequest(
        url: currentUri,
      ),
      initialOptions: InAppWebViewGroupOptions(
        android: AndroidInAppWebViewOptions(
          useOnRenderProcessGone: true,
        ),
      ),
      androidOnRenderProcessGone: (controller, details) {
        // reload the creashed webview
        setState(() {
          inAppWebViewKeyString = Uuid().v4().toString();
        });
      },
    );

Any ideas? I'd really appreciate any pointers anyone might have :)

androideveloper commented 1 year ago

Your crashing webview might come from another internal dependency/sdk that you don't control.