-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 sometimes crash on closing InAppWebView #1675
Comments
👋 @bohowu 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 Following these steps can save you, me, and other people a lot of time, thanks! |
I too face the same problem |
same here |
We're also experiencing the issue on a device we have on hand. Will be looking into it further and post my findings here. |
This seems to be the error coming from the Android device. Only getting it intermittently.
|
@bohowu can you send a full example of the screen/dialog that contains the InAppWebView? |
Same problem.. It doesn't reproduce well in debugging mode. In release mode, it reproduces intermittently. When I followed this solution Changed useHybridComposition from true -> false in AndroidInAppWebViewOptions. It felt like the errors in the experience were reduced. test device - galaxy a8(sm-a530n) |
Same Issue Happening getting frequent crash while exiting the application.
` |
any update? |
same Problem too. |
Are you able to share a minimal code example with steps to reproduce the issue? |
After reading the flutter code, I found out that it was a problem with flutter.
@override
Future<void> _sendDisposeMessage() {
// return _internals.sendDisposeMessage(viewId: viewId);
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
_internals.sendDisposeMessage(viewId: viewId);
});
return Future.value();
} |
You shouldn’t modify flutter internal code. |
Yes it has: |
Hi, Thanks to our QA team, I can finally reproduce the issue with a simple example. Steps to reproduceUse the sample code. The issue can be reproduced reliably with a release build (flutter run --release), while it does not occur in debug mode. (It only happened once in our app.) Here are the steps: Device & Information
Code samplePlease import plugin Code sampleimport 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
void main() => runApp(const MaterialApp(home: HomePage()));
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) => Scaffold(
body: Center(
child: ElevatedButton(
child: const Text("Show WebView in BottomSheet"),
onPressed: () {
showModalBottomSheet<void>(
context: context,
isScrollControlled: true,
builder: (context) => const SizedBox(height: 600, child: InAppWebViewPage()),
);
},
),
),
);
}
class InAppWebViewPage extends StatefulWidget {
const InAppWebViewPage({super.key});
@override
State<InAppWebViewPage> createState() => _InAppWebViewPageState();
}
class _InAppWebViewPageState extends State<InAppWebViewPage> {
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(title: const Text("InAppWebView")),
body: InAppWebView(
initialUrlRequest: URLRequest(url: WebUri("https://buy.line.me/")),
initialSettings: InAppWebViewSettings(useHybridComposition: true),
),
);
} Screenshots or VideoDemo videocheck_exception_crash_demo.mp4LogsRelease build
Debug build
Flutter Doctor outputFlutter Doctor output
|
你好,你是怎么发现是这个代码问题的?我用的百度地图的Flutter版本,应该也是PlatformView引起的在一些手机中崩溃,这样修改之后好像确实不会崩了,我看flutter官网这个issue还是开着的 ,那边作者似乎认为不是flutter的问题@whichname |
当时记了一下:
查看 final PlatformView platformView = platformViews.get(viewId);
if (platformView == null) {
throw new IllegalStateException(
"Platform view hasn't been initialized from the platform view channel.");
} 由于是退出时 crash,所以是由于 现在是否还有这个问题我也不知道了,后来没关注了 |
我的错误日志和你一样。我现在试下来不会崩溃了,我看你前面说有可能是高并发引起的,咨询一下,谢谢 |
Environment
Device information: Xiaomi, Samsung...
Description
We got crash on Firebase crashlytics.
The last message shows on Logs is calling Navigator.pop of the InAppWebView.
Version 5.4.3+8 not occurs this issue, after I update version to 5.7.2+3, issue happens.
We can not reproduce issue on local device.
Expected behavior:
Should not crash.
Current behavior:
There are crashes on Firebase crashlytics.
Steps to reproduce
Open InAppWebView and close it.
I put the InAppWebView in WillPopScope and call Navigator.pop to close page.
But the stack not readable.
Crashed: Thread: SIGABRT 0x0000000000000000
#00 pc 0x89bcc libc.so (BuildId: 4ba2121e6580a7f88bce586ed966851c)
#1 pc 0x89b9c libc.so (BuildId: 4ba2121e6580a7f88bce586ed966851c)
#2 pc 0x34bf18 libflutter.so (BuildId: e2cee5df08eb06fb5b2583dee4f7ebc789c88cd1)
#3 pc 0x33a134 libflutter.so (BuildId: e2cee5df08eb06fb5b2583dee4f7ebc789c88cd1)
#4 pc 0x33a138 libflutter.so (BuildId: e2cee5df08eb06fb5b2583dee4f7ebc789c88cd1)
#5 pc 0x99bffc libflutter.so (BuildId: e2cee5df08eb06fb5b2583dee4f7ebc789c88cd1)
#6 pc 0x8ae704 libflutter.so (BuildId: e2cee5df08eb06fb5b2583dee4f7ebc789c88cd1)
#7 pc 0x8cc9dc libflutter.so (BuildId: e2cee5df08eb06fb5b2583dee4f7ebc789c88cd1)
#8 pc 0x9a1d3c libflutter.so (BuildId: e2cee5df08eb06fb5b2583dee4f7ebc789c88cd1)
#9 pc 0x8ae72c libflutter.so (BuildId: e2cee5df08eb06fb5b2583dee4f7ebc789c88cd1)
#10 pc 0x9a1d3c libflutter.so (BuildId: e2cee5df08eb06fb5b2583dee4f7ebc789c88cd1)
#11 pc 0x10eef0 libflutter.so (BuildId: e2cee5df08eb06fb5b2583dee4f7ebc789c88cd1)
#12 pc 0x7b9dfc libflutter.so (BuildId: e2cee5df08eb06fb5b2583dee4f7ebc789c88cd1)
The text was updated successfully, but these errors were encountered: