Search Unity

Question Experiencing black screen when returning to game after a while

Discussion in 'Android' started by Herkius, Jul 9, 2020.

  1. Herkius

    Herkius

    Joined:
    Jan 9, 2014
    Posts:
    2
    Has anyone else experienced a black screen on their mobile builds? It's happening when the device is unlocked after a long time has passed.
    QA said it crashes if it leaves the game locked for a whole day (13-14 hours), and if I leave the phone locked with the game in the foreground then unlock it after 30-40 minutes I get a black screen for 5-6 seconds (with the game music), then the game starts running again right where I left it.
    Logcat shows nothing, no exceptions, no errors, not even in the crashes.
    Some info about the project:
    • Started with Unity 2018.2, but had to update to 2019.3.15f1. No problems so far with the update, unless this is the first one.
    • 2d game, lots of big images, huge interface with lots of pop up panels.
    • Scene animations done with Spine, UI animations done with LeanTween so no animators are involved in canvases.
    • Getting an average of 80 batches with no GUI present, 100 with GUI panels with lots of elements.
    • SetPass calls around 70, jump to 100 with some GUI panels.
    • Getting 60 fps with fairly old devices (2-3 years old) and almost no heating problems.
    I have been looking into optimizations, gotta start using SpriteAtlases to see if they help. Also I have removed Raycast Target from every UI element that doesn't need to be one. Right now I'm removing Auto Size from TextMeshPro components because I just learned that it should not be used (and I use Auto Size A LOT).
    I have put a log on an GameObject OnApplicationPause and I don't see the log until the game reappears, so it can't be anything I'm doing on code.
    So, anyone has any idea what can be happening?

    Edit: Forgot to say that I'm preloading the bigger images in Player Settings, the backgrounds. Also, for apk size purposes, I'm using crunch compression on the biggest images (scene backgrounds and panels backgrounds), could it be that after a long time the game has to decompress the images again and it somehow fails to?
     
    Last edited: Jul 9, 2020