WSA icon indicating copy to clipboard operation
WSA copied to clipboard

WebViews are blank

Open P5music opened this issue 1 year ago • 4 comments
trafficstars

Steps to reproduce

Create an application with WebViews, compile it in AndroidStudio against WSA and run in the WSA environment. Both debug and release builds are affected. Also sideloaded apks and direct adb installs are affected. Windows11Pro 22H2 build 22621.3447

✔️ Expected Behavior

WebViews have been working for months then suddenly WebViews display blank content.

❌ Actual Behavior

My app has a RecyclerView with WebViews as items. It used to work perfectly, Now When the app starts the content is displayed for the first item, while others are not displayed. Other activities can be opened but WebViews are blank in them too. For example the User Guide activity features a full page WebView that is supposed to display a long HTML document, but it's blank. It's empty. Going back to the main activity with the RecyclerView now there is nothing, and the only WebView that was displaying something is now blank itself. It becomes blank even without opening another activity, it is enough to perform some UI update after start.

Other Software

AndroidStudio Iguana 2023.2.1 (the issue was present with previous Giraffe version too)

Please specify the version of Windows Subsystem for Android

2311.40000.5.0

P5music avatar May 02 '24 21:05 P5music

Possibly related to #548 Try disable hardware acceleration and see what you get.

Slion avatar May 08 '24 14:05 Slion

@Slion Thank you for the response. I have a bunch of options related to hardware acceleration but there is no overall on/off button for that feature. I tried the available options but WebViews are still blank except for some of them when the app starts.

P5music avatar May 08 '24 20:05 P5music

You need to use setLayerType and set it to LAYER_TYPE_SOFTWARE.

Slion avatar May 08 '24 20:05 Slion

@Slion Neither webView.setLayerType(View.LAYER_TYPE_SOFTWARE,null); or android:hardwareAccelerated="false" (on the application element in manifest) worked.

P5music avatar May 08 '24 20:05 P5music