Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Possible auto rotation crash on iOS (Unity 5.2.3p3)

Discussion in 'iOS and tvOS' started by Voldemorten, Feb 29, 2016.

  1. Voldemorten

    Voldemorten

    Joined:
    Apr 2, 2015
    Posts:
    3
    I'm submitting a game to the iOS App Store, and it was rejected due to crash on startup (iOS 9.2.1, using the same on my iPhone test device). Now, please bear with me while I apply some calculated guesswork here, as I have limited experience debugging on iOS. I used to experience startup crashes similar to the one indicated in the crash log when I had auto rotation set to both landscape modes, but no portrait in earlier builds. I pushed the problem aside temporarily by using only one orientation (landscape right).

    However, after I added the following code in my startup class Bootstrap.cs, landscape auto rotation has worked fine and dandy for me:
    Code (CSharp):
    1. Screen.autorotateToLandscapeLeft = true;
    2. Screen.autorotateToLandscapeRight = true;
    3. Screen.autorotateToPortrait = false;
    4. Screen.autorotateToPortraitUpsideDown = false;
    5. Screen.orientation = ScreenOrientation.AutoRotation;
    My question is then if I'm on the right track to assume it has something to do with auto rotation? I found out a few days ago that one of the patch releases for 5.2 addressed a bug on iOS related to this, so I upgraded to 5.2.3p3. Am I doing something wrong in the screen orientation code in my Bootstrap class?

    As a quick fix I'll revert to using a single fixed orientation to submit to Apple for beta review, and see if that circumvents the problem until I can get to the root of it. However, any help would be greatly appreciated :)

    Relevant crash log snippet:
    Last Exception Backtrace:
    0 CoreFoundation 0x18309d900 0x182f78000 + 1202432
    1 libobjc.A.dylib 0x18270bf80 0x182704000 + 32640
    2 CoreFoundation 0x18309d7d0 0x182f78000 + 1202128
    3 Foundation 0x183a1099c 0x18396c000 + 674204
    4 thoughluck 0x1000102d4 -[UnityDefaultViewController supportedInterfaceOrientations] (UnityViewControllerBase.mm:103)
    5 UIKit 0x187e0887c 0x187d7c000 + 575612
    6 UIKit 0x187e082dc 0x187d7c000 + 574172
    7 UIKit 0x187d9172c 0x187d7c000 + 87852
    8 UIKit 0x187f19ecc 0x187d7c000 + 1695436
    9 thoughluck 0x1000bdc8c Bootstrap_Start_m_1389496355_0 (Bulk_Assembly-CSharp_2.cpp:10814)
     
  2. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    This looks like a bug. Could you please check if the same happens on Unity 5.3.3? If you can still see the same issue, please submit a bug report with a reproduction project and post the bug number here. Thanks a lot.
     
  3. nastasache

    nastasache

    Joined:
    Jan 2, 2012
    Posts:
    74
  4. nastasache

    nastasache

    Joined:
    Jan 2, 2012
    Posts:
    74
    Well, the first resolution:
    I have now a project using Unity 5.3.4, Xcode 7.3, and Vuforia not compatible with Unity 5.3.2 and above.
    What I have to do? Where to fill the bug?
     
  5. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Try 5.3.2 then. I'm pretty sure 5.3.x does not have this bug. In case it does, we'd like to see a bug report :)
     
    Last edited: Apr 5, 2016