Search Issue Tracker

Fixed in 2018.2.X

Fixed in 2017.2.X, 2017.3.X, 2017.4.X, 2018.1.X

Votes

0

Found in

2017.3.0f3

Issue ID

984517

Regression

Yes

[iOS] Crash when calling native UIViewController that changes orientation settings

iOS

-

Project is attempting to present UIImagePickerController (Library Photos set, which is the only portrait) while the Unity game is set Auto Rotation as Default Orientation in the iOS Player Settings and Landscape Right and Landscape Left marked as the only allowed Orientation.
The issue only appears on devices running iOS 10, iOS 9 and iOS 8.

Steps:
1. Build and run attached project for iOS ("CrashOrientation.zip")
2. In Player: press Button

Result: player crashes.

From Xcode Output:
2018-01-19 17:08:33.233 orientCrash[2078:1105573] Uncaught exception: UIApplicationInvalidInterfaceOrientation: Supported orientations has no common orientation with the application, and [PUUIAlbumListViewController shouldAutorotate] is returning YES
2018-01-19 17:08:33.234 orientCrash[2078:1105573] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [PUUIAlbumListViewController shouldAutorotate] is returning YES' Reproduced with: 2018.1.0b3, 2017.3.0p3, 2017.2.1p2. Not reproduced with: 2017.1.3f1. Tested with: iPhone 7 plus - iOS11.1 - not reproduced iPhone 7 plus - iOS10.3.2 - reproduced iPad mini 4 - iOS9.2.1 - reproduced iPhone 6 - iOS8.0.1 - reproduced Note: -the original problem was found using ads SDK (see user's email for more info) -not reproducible on devices running iOS 11.'

Comments (3)

  1. Shefich

    May 27, 2019 20:06

    Unity 2018.2.21f1, the issue still exist.
    But I don't have such lines in my code. Maybe it is caused by some 3rd party plugins, like Admob for example.

  2. MikkoHaapoja

    Jun 21, 2018 03:56

    I'm seeing this with Unity 2018.1.5f1.

    The following code will cause this issue:

    void LockOrientation() {
    Screen.autorotateToPortrait =
    Screen.autorotateToLandscapeLeft =
    Screen.autorotateToLandscapeRight =
    Screen.autorotateToPortraitUpsideDown = false;
    }

    void UnlockOrientation() {
    Screen.autorotateToPortrait =
    Screen.autorotateToLandscapeLeft =
    Screen.autorotateToLandscapeRight =
    Screen.autorotateToPortraitUpsideDown = true;
    }

    First call lock and then later unlock.

  3. Valdeco

    Apr 17, 2018 20:30

    Reproduced on Unity 2017.4.1f1 LTS. When will it be back-ported?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.