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. Dismiss Notice

Game crashes when showing ad with specific device

Discussion in 'Unity Ads & User Acquisition' started by pablo_leban, Sep 13, 2020.

  1. pablo_leban

    pablo_leban

    Joined:
    Sep 19, 2013
    Posts:
    64
    Hi! So it seems that on iPadOS 13.7 the game crashes whenever Advertisement.Show(placementId); is called. Every other device works fine. Have anybody noticed this?

    I have the latest Unity Ads version and using Unity 2020.1.3f1.
     
    Last edited: Sep 14, 2020
    unity_QZxQjipxjMG97g likes this.
  2. unity_QZxQjipxjMG97g

    unity_QZxQjipxjMG97g

    Joined:
    Sep 14, 2020
    Posts:
    2
    Yes! I am using an ipod touch, and every time a unity ad plays, I cannot return to the game without force-closing the game, and restarting. It's extremely annoying, and renders the game unplayable.
     
  3. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    Can you post the device logs from when the crash happens? There should be an error message of some kind.
     
  4. unity_QZxQjipxjMG97g

    unity_QZxQjipxjMG97g

    Joined:
    Sep 14, 2020
    Posts:
    2
    There is no error message. Just a black screen. Every single time.
     
  5. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    There should still be something in the device logs that would help give us a clue as to what is going wrong. You can find some information on how to access our log files here:
    https://docs.unity3d.com/Manual/LogFiles.html

    For example, on iOS, you would need to use XCode to capture the logs. This is important as many things can cause a crash, so we need some context to be able to offer a fix :)
     
  6. pablo_leban

    pablo_leban

    Joined:
    Sep 19, 2013
    Posts:
    64
    This is what I get on xcode:

    2020-09-17 16:42:36.389121-0300 IdleSlayer[846:427149] Uncaught exception: UIApplicationInvalidInterfaceOrientation: Supported orientations has no common orientation with the application, and [UADSViewController shouldAutorotate] is returning YES
    (
    0 CoreFoundation 0x0000000182f6f668 707F86B5-2929-3667-B42C-3004C5E0C87D + 1222248
    1 libobjc.A.dylib 0x0000000182c91bcc objc_exception_throw + 56
    2 CoreFoundation 0x0000000182e65a58 707F86B5-2929-3667-B42C-3004C5E0C87D + 133720
    3 UIKitCore 0x00000001869f9c58 96D45309-8A6B-3139-B091-DCDEB4863DBA + 4213848
    4 UIKitCore 0x00000001869eb154 96D45309-8A6B-3139-B091-DCDEB4863DBA + 4153684
    5 UIKitCore 0x00000001869f96e4 96D45309-8A6B-3139-B091-DCDEB4863DBA + 4212452
    6 UIKitCore 0x000000018690acb8 96D45309-8A6B-3139-B091-DCDEB4863DBA + 3235000
    7 UIKitCore 0x0000000186900668 96D45309-8A6B-3139-B091-DCDEB4863DBA + 3192424
    8 UIKitCore 0x00000001869ee9a0 96D45309-8A6B-3139-B091-DCDEB4863DBA + 4168096
    9 UIKitCore 0x00000001869f0358 96D45309-8A6B-3139-B091-DCDEB4863DBA + 4174680
    10 UIKitCore 0x00000001869f2864 96D45309-8A6B-3139-B091-DCDEB4863DBA + 4184164
    11 UIKitCore 0x00000001869f2d6c 96D45309-8A6B-3139-B091-DCDEB4863DBA + 4185452
    12 UIKitCore 0x00000001869f27b4 96D45309-8A6B-3139-B091-DCDEB4863DBA + 4183988
    13 UIKitCore 0x00000001869f2a20 96D45309-8A6B-3139-B091-DCDEB4863DBA + 4184608
    14 UnityFramework 0x0000000104418a38 __153+[UADSApiAdUnit WebViewExposed_open:supportedOrientations:statusBarHidden:shouldAutorotate:isTransparent:withAnimation:homeIndicatorAutoHidden:callback:]_block_invoke + 388
    15 libdispatch.dylib 0x0000000182c349a8 D4F3CE0B-EB3B-3EC8-94E8-82BCD861983A + 371112
    16 libdispatch.dylib 0x0000000182c35524 D4F3CE0B-EB3B-3EC8-94E8-82BCD861983A + 374052
    17 libdispatch.dylib 0x0000000182be75b4 D4F3CE0B-EB3B-3EC8-94E8-82BCD861983A + 54708
    18 CoreFoundation 0x0000000182eed6bc 707F86B5-2929-3667-B42C-3004C5E0C87D + 689852
    19 CoreFoundation 0x0000000182ee8590 707F86B5-2929-3667-B42C-3004C5E0C87D + 669072
    20 CoreFoundation 0x0000000182ee7ba8 CFRunLoopRunSpecific + 424
    21 GraphicsServices 0x000000018d05e344 GSEventRunModal + 160
    22 UIKitCore 0x00000001870233e4 UIApplicationMain + 1932
    23 UnityFramework 0x0000000103819dd0 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 108
    24 IdleSlayer 0x00000001020cfe1c main + 68
    25 libdyld.dylib 0x0000000182d6f8f0 BB016284-6E8E-3E1A-BA06-DC365DDF014A + 6384
    )
    2020-09-17 16:42:36.399326-0300 IdleSlayer[846:427149] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [UADSViewController shouldAutorotate] is returning YES'
    *** First throw call stack:
    (0x182f6f654 0x182c91bcc 0x182e65a58 0x1869f9c58 0x1869eb154 0x1869f96e4 0x18690acb8 0x186900668 0x1869ee9a0 0x1869f0358 0x1869f2864 0x1869f2d6c 0x1869f27b4 0x1869f2a20 0x104418a38 0x182c349a8 0x182c35524 0x182be75b4 0x182eed6bc 0x182ee8590 0x182ee7ba8 0x18d05e344 0x1870233e4 0x103819dd0 0x1020cfe1c 0x182d6f8f0)
    libc++abi.dylib: terminating with uncaught exception of type NSException
    (lldb)
     
    Last edited: Sep 18, 2020
  7. pablo_leban

    pablo_leban

    Joined:
    Sep 19, 2013
    Posts:
    64
    I've managed to fix this. The problem was that I was building the iOS on Portrait as default, but you can switch to Landscape or Auto-Rotate with the ingame settings. So if the user tried to watch a video and the settings was on Landscape, the game crashed.

    The solution is to allow every screen orientation (or at least the ones your game supports) by default.
     
  8. bjornman95

    bjornman95

    Joined:
    Nov 3, 2021
    Posts:
    2
    Hi, pablo_leban! I've tried your solution on my app, but still encountered this issue.
    I set LandscapeLeft as default orientation in Unity Project Settings, then checked all device orientation (except Upside Down) in XCode project settings. Am I missing something?
     
  9. pablo_leban

    pablo_leban

    Joined:
    Sep 19, 2013
    Posts:
    64
    Make sure to use the orientation settings from the Player Settings instead of changing the settings from XCode.
    upload_2022-4-5_15-37-25.png

    Also, make sure to have the latest Unity LTS version and the Unity Advertisement package updated and see if that works.
     
  10. bjornman95

    bjornman95

    Joined:
    Nov 3, 2021
    Posts:
    2
    But what if I don't want auto-rotation to be On?
    I would like the players to change orientation by toggling an in-game button, not by auto-rotating their device.
    Is it possible to do this?
     
    Last edited: Apr 6, 2022