Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Random crash on launch - only sometimes

Discussion in 'iOS and tvOS' started by ignitiongames, Jul 5, 2015.

  1. ignitiongames

    ignitiongames

    Joined:
    Feb 27, 2015
    Posts:
    20
    Hey everyone, I'm getting close to launching my game into beta testing on the App Store but I am plagued with a crash on start about 60-70% of the time my game is launched. Below is an image of the stack:



    I'm fairly new to Unity and iOS development/XCode so I cant really tell if this is a Unity issue or not. This crash is right after my splash screen and it happens a good majority of the time the app is launched from the device. Any input on this would be greatly appreciated as its holding up the release of my game.

    Thanks!
     
  2. ignitiongames

    ignitiongames

    Joined:
    Feb 27, 2015
    Posts:
    20
    So after a bit of experimentation and re-reading the stack trace it became apparent that it was crashing because of a material, so I looked down to see that SetupSun was being called. I checked out my sun flare setup (which is the spacesun from Unity's Lens Flares asset store product) and seeing that it was imported as an Advanced Texture got me thinking that this could be causing the crash.

    As soon as I unlinked the flare from the light source and rebuilt, the crash hasn't happened. Here are the import settings for the spacesun flare texture:



    If anyone has any suggestions as to what Unity doesn't like about this, let me know as this is a beautiful lense flare effect.
     
  3. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    hm, looking through code it seems we shouldnt touch flare/halo/whatever there. Can you please create small repro case and bug report? Drop case number here.
     
  4. ignitiongames

    ignitiongames

    Joined:
    Feb 27, 2015
    Posts:
    20
    Case # is 706236. I re-enabled Metal as a rendering API and changed the texture from "Advanced" to "Texture" and it seems to have fixed the crash.
     
  5. ignitiongames

    ignitiongames

    Joined:
    Feb 27, 2015
    Posts:
    20
    Update: It seems that this didn't solve the crash, it just made it happen less often. I tried disabling Metal again and the game launched 10 of 10 times in a row so it seems this in fact is Metal specific hence line 3 of the stack trace.
     
  6. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    That one is pretty weird and looks like some crazy issue in compiler vs ios-runtime vs our code. I'm digging into it but for now disable metal indeed.
    P.S. i would recommend to upgrade to 5.1, as 5.0 will not get any fixes
    P.P.S. "close to launching my game into beta testing on the App Store" - switch to il2cpp then, mono is 32bits only - so you will be rejected most likely
     
  7. ignitiongames

    ignitiongames

    Joined:
    Feb 27, 2015
    Posts:
    20
    Thanks Alexey! I have upgraded to 5.1.1f1 since that case was filed and this issue has persisted. I have been building in il2cpp for app store submissions and mono for quick tests and the crash results are the same for both.
     
  8. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    ah, sure - i reproed on 5.2 + il2cpp no worries
    i was just giving heads up on possible issues i saw
     
  9. ignitiongames

    ignitiongames

    Joined:
    Feb 27, 2015
    Posts:
    20
    I appreciate it Alexey, keep me updated if you find anything :)