Bizarre orientation bug in AppStore build only

This has got to be the strangest bug I’ve seen in all my years as a developer.

I’ve built an iPhone app that displays content in portrait mode, then changes orientation from landscape to portrait using Screen.Orientation = ScreenOrientation.LandscapeLeft.

I build in Unity, then compile the app in XCode using an Ad Hoc provisioning profile. I send it out to my beta testers and everything works fine.

I compile the exact same app again in XCode (not even rebuilding in Unity) with the only change being that I use an App Store provisioning profile. I submit it to the AppStore, it gets approved and released, but…

The screen orientation change doesn’t work.

When it switches from portrait to landscape, I get landscape mode but what appears to be portrait-mode aspect ratio with a large black area to the right. See attached screenshot.

I’m using Unity 5.3.4p1 and the latest version of XCode, and testing on multiple iPhones from 4s to 6 running various versions of iOS.

This happens only in the App Store build, not in that Ad Hoc build. It’s extremely hard to debug, since I have to do an App Store submission each time. :frowning:

Any suggestions would be greatly appreciated.

Thanks!

Code to change orientation:

private IEnumerator FlipAndDisplay() {
Screen.orientation = ScreenOrientation.LandscapeLeft;
yield return null;
readyScreenWebview.Show();
}

Hi, could you please check whether this happens with Unity 5.3.5, and if it does, submit a bug report with a small reproduction project attached? Thanks

Will do, thanks.

I tried upgrading to Unity 5.3.5, and it seems to have solved the problem.

However… now none of my user interfaces work. :frowning:

I’m developing using Google Cardboard, which uses render textures to do lens distortion. But apparently there’s a bug which causes world space canvases to not appear in render textures (as of 5.3.4p2).

So I can either use 5.3.4p1 (which has the aspect ratio problem) or 5.3.5 (which doesn’t show world space canvases).

Any suggestions? I’m really stuck, and have a client breathing down my neck.