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:
After digging really deep, I found that some people fix this by disabling Optimized Frame Pacing In PlayerSettings>ResolutionAndPresentation>Optimized Frame Pacing. I’m going to try that and tell you if it worked, if you try it, please let me know if it fixed it for you.
My game plays at a silky smooth 60fps and then sometimes suddenly slows down until it almost stops. I can’t find rhyme or reason in when it happens. I quit the game, load from the same place and it works fine again. There’s no errors, nothing else in the profiler seems out of the ordinary. This is in Unity 2020.3.18f1.
I’ll try the proposed solution of disabling optimize frame pacing.