Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

Orientation and rotation issues when Building Unity App to iOS 6 beta 4

Discussion in 'iOS and tvOS' started by unityRich, Aug 12, 2012.

  1. unityRich

    unityRich

    Joined:
    Aug 12, 2012
    Posts:
    7
    We have created a Unity iOS app we hope to release this fall.

    My app has been building fine to iOS 5.1 devices and the application launches into landscape view without error and then pulls up the main window (also in landscape ... as it should). I also enabled orientation changes for both version of landscape, which work great on 5.1 as well. Testing on iPad 3rd gen.

    We plan on publishing for iOS 6 and so are currently testing on the latest beta 4, but when I test, I am encountered some unusual behaviour. These issues only show up when building for iOS 6 on a device with iOS 6. My gut says maybe something may have changed in the build pipeline from Unity to Xcode.

    Essentially the start screen comes up in landscape as it should, but unlike the builds for 5.1, the iOS 6 build displays the the main window in Portrait and screen all rotations are lost.

    I get an error in the console that says:

    Application windows are expected to have a root view controller at the end of application launch

    This only happens when publishing for iOS 6 on a device with iOS 6. Has anyone else encountered anything like this who is currently testing a Unity App destined for iOS6.

    Perhaps this may be resolved in the next Unity Update that will follow with the release of iOS 6, but if anyone has any advice that could resolve the issue, I'd be happy to hear it.
     
  2. coolpowers

    coolpowers

    Joined:
    Mar 23, 2010
    Posts:
    125
    Unity generally doesn't support the pre-release versions of iOS6, and the NDA limits what you can talk about (not that that stops the rest of the internet). I do know orientation stuff has undergone changes though.

    For situations like this it would be nice if Unity could build to the simulator.
     
  3. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @cool, Unity can build to the simulator:
     
  4. coolpowers

    coolpowers

    Joined:
    Mar 23, 2010
    Posts:
    125
    How long has that been there?!
     
  5. neror

    neror

    Joined:
    Jul 25, 2011
    Posts:
    6
    Unity autorotation is a mess in iOS 6. I was able to fix the "Application windows are expected to have a root view controller at the end of application launch" error by setting the UnityViewController as the window's rootViewController during the engine init in AppController.mm. Unfortunately, that was not enough to fix the autorotation issue.

    Rather than continuing to mess with it, my temporary solution during development is to support a single orientation rather than autorotation. The splash screen is still messed up during load, but the game ends up in the proper orientation and aspect ratio once it's loaded. Select Landscape Left or Landscape Right for the Default Orientation setting in the iOS player settings and you should be good to go.
     
  6. klicktock

    klicktock

    Joined:
    Jun 9, 2011
    Posts:
    7
    The issue is that, if you don't support auto-rotation between left and right, you run the risk of being rejected by Apple.
     
  7. neror

    neror

    Joined:
    Jul 25, 2011
    Posts:
    6
    Yes, you should be rejected for not supporting both landscape orientations. I only used that workaround so I could continue developing for iOS 6. This will be a much bigger issue next week.
     
  8. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    This may be a silly question, but does Unity know about the problem? Was a bug report submitted? I have not upgraded to iOS6 or Xcode 4.5 yet, so I have not experienced it yet.
     
  9. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    For the folks out there that havent figured this all out yet check out this post for the details of how to fix it.
     
unityunity