I have an Android game, and everything works perfectly in the Editor, but when I run it on my Android device, it crashes sometimes.
This is how it goes: I'll be playing my game, and randomly, or because of a reason that I don't know, the game will quickly drop in FPS, it starts to go slower and slower until it's frozen at 1 FPS. Changing scenes when it starts to slow down, is possible, but it ends up crashing anyway.
It's not a device issue since it has happened on multiple devices.
It's also not a scene-specific crash. It's happened on my menu scene, game scene, and level creator scene.
It happens very rarely, today it took me about an hour of playing until I could replicate this bug, it eventually happened, and this time I had the profiler attached:
As you can see, VSync goes up to 5000+ms, the function causing the problem seems to be:
PlayerLoop -> PostLateUpdate.FinishFrameRendering -> Gfx.WaitForPresentOnGfxThread -> WaitForTargetFPS -> Semaphore.WaitForSignal
But I haven't found out exactly what this is or how to solve it.
Does anyone know how to fix this?