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.14k stars 1.46k forks source link

flutter_inappwebview crashes on vivo Android devices #1548

Open OnesWYong opened 1 year ago

OnesWYong commented 1 year ago

Environment

Technology Version
Flutter version 3.7.3
Plugin version 5.3.2
Android version 9
iOS version null
macOS version null
Xcode version null

Device information:

name: vivo Z3 model: V1813BT vivo ROM: Funtouch OS_10 Android version: 9

Description

Expected behavior: App displays normally

Current behavior: App crashes

Steps to reproduce

  1. Start application A
  2. Switch to background
  3. Wait 10 minutes. (Not sure about the exact time. The longer the time, the greater the probability of occurrence)
  4. Open App A
  5. Application A crashes

Images

Stacktrace/Logcat


I/flutter (31675): onProgressChanged:80
W/chromium(31675): [WARNING:spdy_session.cc(3058)] Received HEADERS for invalid stream 85
2
I/flutter (31675): onProgressChanged:100
I/OpenGLRenderer(31675): Initialized EGL, version 1.4
D/OpenGLRenderer(31675): Swap behavior 2
F/google-breakpad(32752): Microdump skipped (uninteresting)
W/google-breakpad(31675): ### ### ### ### ### ### ### ### ### ### ### ### ###
W/google-breakpad(31675): Chrome build fingerprint:
W/google-breakpad(31675): 68.0.3440.91
W/google-breakpad(31675): 344009150
W/google-breakpad(31675): ### ### ### ### ### ### ### ### ### ### ### ### ###
F/libc    (31675): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x40 in tid 31918 (RenderThread), pid 31675 (le.test_webview)
Softversion: PD1813D_A_7.8.30
Time: 2023-02-16 11:38:41
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'vivo/PD1813D/PD1813D:9/PKQ1.181030.001/compiler07221602:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 31675, tid: 31918, name: RenderThread  >>> com.example.test_webview <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x40
Cause: null pointer dereference
    x0  000000726386fce8  x1  0000007285e4c7a0  x2  0000000000000001  x3  0000000000000000
    x4  0000000000000001  x5  0000000000000000  x6  0000000000000000  x7  1843e42c23593438
    x8  000000726607d9b0  x9  000000730ddfb408  x10 0000000000000005  x11 0000000000000000
    x12 0000000000000050  x13 1843e42c23593438  x14 0000000000000000  x15 000000730ddf6a48
    x16 000000730de1f5d0  x17 000000730d9ace38  x18 0000000000000000  x19 000000726607f588
    x20 000000726556fd10  x21 00000072659517e0  x22 0000000000000003  x23 000000730d94bbe8
    x24 000000730d9e68a8  x25 000000726607f588  x26 000000730de17388  x27 0000000000003815
    x28 0000000000000000  x29 000000726607d930
    sp  000000726607d910  lr  000000730d974d54  pc  000000730d839298
backtrace:
    #00 pc 000000000021c298  /system/lib64/libhwui.so (GrGLRenderTarget::getBackendRenderTarget() const+60)
Lost connection to device.
Exited
Code sample pubspec.yaml ``` environment: sdk: ">=2.7.0 <3.0.0" dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.2 flutter_inappwebview: 5.3.2 ``` main.dart: ```dart import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({ Key key, this.title, }) : super(key: key); final String title; @override State createState() => _MyHomePageState(); } class _MyHomePageState extends State { InAppWebViewController webViewController; final url = "https://www.baidu.com"; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(widget.title), ), body: Stack( fit: StackFit.expand, children: [ InAppWebView( initialUrlRequest: URLRequest(url: Uri.parse(url)), initialOptions: InAppWebViewGroupOptions( crossPlatform: InAppWebViewOptions( useShouldOverrideUrlLoading: true, ), android: AndroidInAppWebViewOptions(), ), onWebViewCreated: (webViewController) { webViewController = webViewController; }, onLoadStart: (controller, url) {}, onLoadStop: (controller, url) async {}, onProgressChanged: (controller, process) {}, onReceivedServerTrustAuthRequest: (controller, challenge) { return Future.value(ServerTrustAuthResponse( action: ServerTrustAuthResponseAction.PROCEED)); }, ), ], ), ); } } ```
github-actions[bot] commented 1 year ago

👋 @OnesWYong

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!

OnesWYong commented 1 year ago

Is there any progress on this issue

wtwsky commented 3 months ago

I have same issue!!! Use flutter_inappwebview,then app switch to background,open the app again,app crash. Android 9 And Android 8.1.