black screen on android after locking and unlocking phone

This has been an ongoing problem with every version of Unity I have run.
I am now using the December 12 release of 2017.2.1f1.

My app starts fine, it runs fine, it prevents the screen from sleeping just fine but if you manually lock the screen and leave it that way for more than a few seconds, when unlocking the screen the only thing that renders is the ad.

This is a simple scene, it’s a clock face. The clock consists of mostly sprites and some static 3d objects. I’m using standard shaders on all but one of the clocks but all of them have the same issue. I saw one other person had this issue and it went away when they updated their Unity 3d IDE, that didn’t fix anything for me.

I know android likes to kill processes to save resources so I have streamlined it as much as I can think of, streaming audio, reduced frame rate, smaller images. I am just not sure what to look at next at this point.

I’m not advertising here, if it will help to answer my question my clock programs are on the android store right now under gnomesnacks.

Any help would be greatly appreciated.

I had the same problem with a black screen after locking up a smartphone. (Unity version: 2018.2.14f1)


I am using OnRenderImage() with Graphics.Blit(source, destination, material); where basic post-processing effects are taking place. When I don’t use the post-processing, everything works fine.


Fix: I fixed the problem by enabling flag Disable Depth and Stencil in Player Setting (Android) -> Resolution and Presentation -> Disable Depth and Stencil* (TRUE)

Now everything works perfectly after locking/unlocking even with post-processing effects.


Here is my Player Settings Resolution and Presentation:

148503-disabledepthandstencil.png