ludei / webview-plus

Uniform webview on any Android 4.x device.
103 stars 16 forks source link

Black screen #1

Closed spacepluk closed 10 years ago

spacepluk commented 10 years ago

Sometimes the app screen turns to black. It's easy to reproduce if you go the app switcher and back several times. Eventually the app turns black and the only way to fix it is killing it. I'm not sure if it's related but I get a lot of these through logcat:

W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.
W/AwContents(23278): nativeOnDraw failed; clearing to background color.

I'm getting this on a Nexus 5 with the latest updates, and a Nexus 7 (old version) with Cyanogenmod nightlies.

ludei commented 10 years ago

Hello spacepluk

I cannot reproduce the problem, I've tried with my Nexus 4 and it works correctly doing this:

After several tests, the app has been running correctly.... I have more devices at the office so I'll try to reproduce the problem on them.

And yes, the nativeOnDraw could be related to the problem.

spacepluk commented 10 years ago

Hmm, I'm using a WebGL canvas in the webview maybe is that what is triggering the problem.

Try pointing your application to this url (http://www.goodboydigital.com/pixijs/bunnymark/), and then do the dancing with the switcher. I hope it helps.

ludei commented 10 years ago

I've tried with that url and it also works correctly, I'll try with other devices then.

Thanks

ludei commented 10 years ago

Got it!

I/chromium(20593): [20593:20593:0702/115306:34244215909:INFO:CONSOLE(1)] "exception firing resume event from native", source: (1) W/AwContents(20593): nativeOnDraw failed; clearing to background color.

and I can see the black screen, we are working on this task so I'll keep you informed.

spacepluk commented 10 years ago

Great! Thank you! :)

ludei commented 10 years ago

Hello spacepluk

Please download this .zip https://dl.dropboxusercontent.com/u/22509177/apks/HelloCordova-debug.apk.zip, extract it and install the apk: $ adb install -r HelloCordova-debug.apk

Does this apk solves your problem?

spacepluk commented 10 years ago

Excellent! This fixes the problem with the black screen :) Also the switching is a lot smoother than before :+1: :+1:

I have no idea if this is related but, when the app starts for the first time there's a strange artifact on top of the canvas. It's a white box that flashes like it's rendering every two frames or so. Once I go to the switcher and back it goes away :?

Also, I'm still getting the nativeOnDraw failed logs.

The same example in Chrome Beta from GooglePlay doesn't have the artifact, but this is v36 I think.

I only see the artifact in my Nexus 7, because in the Nexus 5 the canvas covers the whole screen so I can't tell if it's there or not. I managed to take a picture of it:

screenshot_2014-07-02-18-21-37

ludei commented 10 years ago

mmmm, I'll close this issue in the next release of the Webview+ and will open another one with that :) thank you!

spacepluk commented 10 years ago

Heheh, ok, thanks!

Behrouz-m commented 10 years ago

I have this issue with default Android webview. How did you fix that ?

kubido commented 10 years ago

@ray-pixar +1, still can't find how to fix this issue

cyrillegr commented 10 years ago

Same issue with the default android webview on Kitkat 4.4.4. How did you fix that ? Thanks