Search Unity

iOS crash after using Unity Ads 2019.2.12f1

Discussion in 'iOS and tvOS' started by bartofzo, Dec 15, 2019.

  1. bartofzo

    bartofzo

    Joined:
    Mar 16, 2017
    Posts:
    151
    Hi,

    After implementing Unity Ads (downloaded from asset store). I'm getting the following crash on iOS:

    Code (CSharp):
    1. 2019-12-15 16:47:00.093529+0100 fungi[1464:287851] Uncaught exception: NSInvalidArgumentException: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]
    2. (
    3.     0   CoreFoundation                      0x0000000207a09294 <redacted> + 252
    4.     1   libobjc.A.dylib                     0x0000000206be39f8 objc_exception_throw + 56
    5.     2   CoreFoundation                      0x0000000207982ce8 _CFArgv + 0
    6.     3   CoreFoundation                      0x00000002078fd5c4 <redacted> + 284
    7.     4   CoreFoundation                      0x00000002078f6d88 <redacted> + 52
    8.     5   fungi                               0x000000010153e1bc +[USRVBannerBridge loadBannerPlacement:bannerAdId:size:] + 272
    9.     6   fungi                               0x000000010153c9c0 -[UADSBannerView bridgeLoad] + 120
    10.     7   fungi                               0x000000010153bab0 -[UADSBannerAdRefreshView reload] + 48
    11.     8   fungi                               0x000000010153be24 __42-[UADSBannerAdRefreshView createNewTimer:]_block_invoke + 200
    12.     9   Foundation                          0x00000002084908a4 __NSFireTimer + 84
    13.     10  CoreFoundation                      0x000000020799b650 <redacted> + 28
    14.     11  CoreFoundation                      0x000000020799b380 <redacted> + 864
    15.     12  CoreFoundation                      0x000000020799abb4 <redacted> + 248
    16.     13  CoreFoundation                      0x0000000207995b04 <redacted> + 1844
    17.     14  CoreFoundation                      0x00000002079950b0 CFRunLoopRunSpecific + 436
    18.     15  fungi                               0x00000001007af94c -[UnityAppController(Rendering) processTouchEvents] + 184
    19.     16  fungi                               0x00000001007afa40 -[UnityAppController(Rendering) repaintDisplayLink] + 104
    20.     17  GPUToolsCore                        0x00000001082309fc -[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 200
    21.     18  QuartzCore                          0x000000020bd90f90 <redacted> + 636
    22.     19  IOKit                               0x0000000207c654b0 IODispatchCalloutFromCFMessage + 488
    23.     20  CoreFoundation                      0x0000000207974a8c <redacted> + 188
    24.     21  CoreFoundation                      0x000000020799b690 <redacted> + 56
    25.     22  CoreFoundation                      0x000000020799addc <redacted> + 440
    26.     23  CoreFoundation                      0x0000000207995c00 <redacted> + 2096
    27.     24  CoreFoundation                      0x00000002079950b0 CFRunLoopRunSpecific + 436
    28.     25  GraphicsServices                    0x0000000209b9579c GSEventRunModal + 104
    29.     26  UIKitCore                           0x00000002341c4978 UIApplicationMain + 212
    30.     27  fungi                               0x00000001007a7dfc main + 156
    31.     28  libdyld.dylib                       0x000000020745a8e0 <redacted> + 4
    32. )
    I've found the same error in this topic:
    https://forum.unity.com/threads/ios...cpp-using-unity-2018-3b3.563707/#post-3741766

    But it's about the 2018 beta. It talks about the Unity Analytics package that needs to be updated. The version that is in my project is 2019.2 verified.

    Thoughts? Thanks.
     
    IgorAherne likes this.
  2. bartofzo

    bartofzo

    Joined:
    Mar 16, 2017
    Posts:
    151
    OK, did some experimenting and it has nothing to do with the post I mentioned above.

    I was calling

    Code (CSharp):
    1. Advertisement.Banner.Show();
    without supplying a PlacementId value. Then I think when calling hide it crashes. Now when I provide PlacementId it doesn't crash. Is this desired behaviour? A fatal crash?

    I'm leaving the banner out as it doesn't always display even and rolling an app out when I know it can fatally crash seems risky.
     
  3. Splashy_Games

    Splashy_Games

    Joined:
    Aug 28, 2019
    Posts:
    2
    Thanks man! This solved the problem. Unity should handle this, btw