codenameone / CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.
https://www.codenameone.com/
Other
1.71k stars 405 forks source link

WebBrowser crashes on UWP #1854

Closed shannah closed 7 years ago

shannah commented 8 years ago

In the Kitchen Sink demo, the web browser crashes the application. The crash occurs when generating the peer image.

I have narrowed it down to this line:

await ((WebView)element).CapturePreviewToStreamAsync(stream);

https://github.com/codenameone/CodenameOne/blob/master/Ports/UWP/VSProjectTemplate/UWPApp/src/com/codename1/impl/SilverlightPeer.cs#L135

And it appears to happen because the webview visibility is set to Collapsed. Setting it to visible fixes the issue, however, for some reason, I still don't see any web view content in the kitchen sink demo. So requires further investigation.

mwarnett commented 7 years ago

I too have experienced several crashes using the WebBrowser component on a Windows Mobile Phone. Dump files available on request.

Even when it does not crash, nothing is displayed.

Sample program that should display HTML output. Works in simulator, empty screen on device.

`package com.mycompany.myapp;

import com.codename1.components.ToastBar; import com.codename1.components.WebBrowser; import com.codename1.ui.AutoCompleteTextField; import com.codename1.ui.Button; import com.codename1.ui.Display; import com.codename1.ui.Form; import com.codename1.ui.Dialog; import com.codename1.ui.FontImage; import com.codename1.ui.Label; import com.codename1.ui.spinner.Picker; import com.codename1.ui.plaf.UIManager; import com.codename1.ui.util.Resources; import com.codename1.io.Log; import com.codename1.ui.Command; import com.codename1.ui.Toolbar; import com.codename1.ui.events.ActionEvent; import com.codename1.ui.events.ActionListener; import com.codename1.ui.layouts.BorderLayout; import java.io.IOException;

/**

mwarnett commented 7 years ago

This is still not working for me. there were two issues originally reported. Displaying a web page could crash the app and if it did not crash, the content was blank.

I am not getting anymore crashes but I am not betting any HTML content either. My above sample code reproduces the problem. Run it on a Windows Mobile device and it should display several lines of HTML output. All I get is a blank screen.

mwarnett commented 7 years ago

Just got the Friday library update and this is still an issue.

shannah commented 7 years ago

This wasn't included in the update this week because I am working on other larger changes with the WebBrowser component.