Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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:
    29
    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:
    29
    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.