Search Unity

Bug Crash after showing an Ad on iOS 12

Discussion in 'Unity Mediation' started by VoxelMatt, Aug 17, 2022.

  1. VoxelMatt

    VoxelMatt

    Joined:
    Apr 22, 2015
    Posts:
    42
    Hi - when testing ads on iPhones stuck running 12.5.5 (Like the iPhone 6s)

    Note: This only happens if the device hasn't been rotated with the game open. If you rotate the scene once, it works fine.

    After I finish watching and then close the ad, the game crashes with this error:

    Code (CSharp):
    1. Uncaught exception: UIApplicationInvalidInterfaceOrientation: Supported orientations has no common orientation with the application, and [UADSViewController shouldAutorotate] is returning YES
    Help! Does anyone have any solutions?
     
    Last edited: Aug 17, 2022
  2. VoxelMatt

    VoxelMatt

    Joined:
    Apr 22, 2015
    Posts:
    42
    OK I worked it out. It's my fault :)

    I was calling
    Code (CSharp):
    1. Screen.autorotateToLandscapeLeft = false;
    2. Screen.autorotateToLandscapeRight = false;
    3. Screen.autorotateToPortrait = false;
    4. Screen.autorotateToPortraitUpsideDown = false;
    before showing an ad to prevent some other rotation issues, and that caused the crash.

    Weird that it only crashes on iOS 12 though.
     
    DeclanMcPartlin likes this.
  3. unity_38F5F208A20B1177C02C

    unity_38F5F208A20B1177C02C

    Joined:
    Apr 25, 2022
    Posts:
    15
    Unity 2021.3.13 - I faced with the same problem on devices with iPadOS 15.6.1/iOS 16.1.1/iOS 15.5.0 @kyle-unity

    Fatal Exception: UIApplicationInvalidInterfaceOrientation
    Supported orientations has no common orientation with the application, and [VungleInternalMRAIDViewController shouldAutorotate] is returning YES