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
[webview_flutter][android] webview crashes when embedded in a scrollview #104889
Comments
Hello @robert-virkus. I can reproduce the distorted behavior you described. Though, can you provide me with an example of a crash happening? Any URL or specific HTML content that causes this? |
Calling this with https://enough.de/bug/crash.html as the URL leads to a distorted view on the emulator but to a crash on my Android 11 / API Levevl 30 device. The main culprit seems to be
Logs
|
Thank you @robert-virkus for that URL. I can confirm that the app does crash in both stable and master channels. Logs for
|
CC: @blasten |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
My webview update its height dynamically, according to result returned by javascript code. After some experimentation, I found one bandage 'fix' is to limit webview's height to around 6000. Hope this issue get fixed soon. |
@anhtuan23 there were similar problems in the past, limiting the webview's height was working but the actual value was device and memory dependent. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I have the same issue when update the Container's(parent of a WebView) height property dynamically. |
Wouldn't recommend this, in my testing it crashes on different sizes. On lower end devices as low as 1500 |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as off-topic.
This comment was marked as off-topic.
Hello everybody. I recommend you thumbs up the original post (#104889 (comment)) instead of commenting "same here". This will give us a better idea about which issues to prioritize. Thank you :) |
This is generally not the case for Flutter 3.0+; the docs around rendering mode for webview_flutter are currently outdated (see #108106).
This is not surprising since TLHC doesn't use views in the usual way.
TLHC didn't exist as a platform view mode until Flutter 3.0, so it's normal that an issue specific to that mode wouldn't reproduce in Flutter 2.
I'm not sure why you believe that it's difficult to conclude that limitation documented in the platform API that we are using to implement TLHC is a limitation in the platform. If you are aware of a different way to implement the relevant texture paths that aren't subject to this documented limitation, pointers are welcome. |
@bparrishMines I've updated #108106 accordingly; once v4 lands we can plumb the option in. |
I understood that using hybrid composition might solve the crash. I tried the following in the above sample project: Borth crash with the same stacktrace: Looking forward to the v4 release! |
That selection currently doesn't do anything in Flutter 3.0 and later, per the issue referenced in my comment above. |
Hello @stuartmorgan
Can you also provide an example of how to set the displayWithHybridComposition value? |
@JosephNK There are examples of using platform-specific parameters later in the readme: https://pub.dev/packages/webview_flutter#platform-specific-features |
@stuartmorgan WebViewWidget.fromPlatformCreationParams seems to be used like this.
|
@bparrishMines Maybe it's worth adding example code to for HC to |
@stuartmorgan @bparrishMines When are you going to add HC examples to |
@JosephNK Sorry, here is an example of using Hybrid Composition: late final WebViewWidget webViewWidget;
if (WebViewPlatform.instance is AndroidWebViewPlatform) {
webViewWidget = WebViewWidget.fromPlatformCreationParams(
params: AndroidWebViewWidgetCreationParams(
controller: _webViewController.platform,
displayWithHybridComposition: true,
),
);
} else {
webViewWidget = WebViewWidget(controller: _webViewController);
}
Yea, that or it might be worth adding more example code using platform specific code to the dart docs of each class in |
@bparrishMines Thank you |
But this's will lead to , webview don't destroy!!! |
This comment was marked as off-topic.
This comment was marked as off-topic.
This issue is assigned to @johnmccutchan but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks! |
When using a webview inside of a scrollview, some content renders a completely distorted page and some content even crashes the app. This problem only affects Androidm the same app, on iOS the same code results in a correclty rendered web page. Rendering the same content also works fine on Android, when not embedding the webview inside of a scrollview.
Steps to Reproduce
flutter run
on the code sampleExpected results:
A web view that is shown within a scrollable view should render content corretly and without crashing the app.
Actual results:
A completely distorted page, some html code also crashes the app.
Code sample
Logs
The text was updated successfully, but these errors were encountered: