Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug Game freezes on startup for iPhones 12 and below only

Discussion in 'iOS and tvOS' started by albertk91, Oct 3, 2023.

  1. albertk91

    albertk91

    Joined:
    Sep 3, 2022
    Posts:
    3
    Hi!

    I'm developing a mobile game in Unity 2022.3.10f with URP and I'm having a weird issue where only iPhones 12 (both regular and pro) and below freeze at when launching the game.

    Unfortunately, I don't have such a device on hand, so the next best thing I could do for troubleshooting is building the game for the Xcode Simulator and seeing what happens.
    I've spent the better part of a day troubleshooting a crash on play, until I finally found out that if I force the max texture res of 1024, it runs without issue. I remembered seeing something about this before, but I was a dummy and forgot to press the apply on the forced setting initially. :oops:
    I couldn't find any errors in the simulator, even simulating as far back as an iPhone 7. Runs flawlessly with 1024 textures in the sim.

    I have a hunch it's something about the textures, because ever since I did a significant round of texture optimization (using Sprite Atlases and limiting texture sizes to the bare minimum), the freeze occurs later in the loading process - in the main menu now, as opposed to right as the splash screen started, as it used to.

    According to info I found in Google, the iPhone 12 series should have no issue handling 4k textures. I do have an 8k*2k atlas now, but that's only been added very recently. Before this version, the biggest textures the game had have been 2k ones.

    What would be a good way to go about debugging this error?
    I asked my friend to try and run the game on an iPhone 7. It does crash on that device, which at least gave me a chance to check the crash report.
    I'm an Xcode noobie, so all I got out of this report is that the error is called
    IOGPUMetalCommandBufferStorageAllocResourceAtIndex
    on Thread 28.

    The simulator error with the texture size was
    EXC_BAD_ACCESS
    , so I'm not sure it's the same thing, but I'm running out of ideas. The 12s aren't even decent enough to crash properly, they just freeze and give me nothing.

    Getting my hand on an iPhone 12 is not an option for me currently. It runs on iPhones 13 and up flawlessly.

    Any tips are greatly appreciated!