Search Unity

Calling Video Ad crashes the app

Discussion in 'Unity Ads & User Acquisition' started by francisIsFine, Apr 13, 2021.

  1. francisIsFine

    francisIsFine

    Joined:
    Jun 26, 2018
    Posts:
    40
    My game in production also has started crashing whenever a video ad is called. Test ads work fine when I debug in test mode. I use Unity Ads 3.7.1

    here's the log I see:

    2021-04-12 17:36:59.466052-0400 OneMan[5273:1379857] Uncaught exception: NSInvalidArgumentException: *** +[NSString stringWithUTF8String:]: NULL cString
    (
    0 CoreFoundation 0x000000019ef119ec F3021642-E3C0-33F8-9911-DD303A6056D0 + 1157612
    1 libobjc.A.dylib 0x00000001b3294b54 objc_exception_throw + 56
    2 Foundation 0x00000001a00a4d14 712A564E-5058-3EAC-AF3A-43BBD43D0D7E + 7444
    3 UnityFramework 0x0000000102296d00 UnityAdsShow + 80
    4 UnityFramework 0x000000010322f904 IosPlatform_Show_mBA034DA3A839CFEC32553ABDD43CA959C72F1E87 + 124
    5 UnityFramework 0x0000000102ec80e0 U3CShowVideoAdWhenReadyU3Ed__23_MoveNext_mB3928E9887F21573AE6957FD04081E3E5C3B4303 + 160
    6 UnityFramework 0x000000010326c32c SetupCoroutine_InvokeMoveNext_m036E6EE8C2A4D2DAA957D5702F1A3CA51313F2C7 + 196
    7 UnityFramework 0x0000000102251390 _Z89RuntimeInvoker_FalseVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5_RuntimeObject_IntPtr_tPFvvEPK10MethodInfoPvPS4_ + 28
    8 UnityFramework 0x0000000102de42a0 _ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException + 116
    9 UnityFramework 0x00000001026b67a8 _Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb + 124
    10 UnityFramework 0x00000001026c11c4 _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 120
    11 UnityFramework 0x00000001026cb2e0 _ZN9Coroutine14InvokeMoveNextEP21ScriptingExceptionPtr + 164
    12 UnityFramework 0x00000001026caecc _ZN9Coroutine3RunEPb + 52
    13 UnityFramework 0x00000001026cd1ec _ZN13MonoBehaviour24TryCreateAndRunCoroutineE18ScriptingObjectPtr18ScriptingMethodPtrPP9Coroutine + 348
    14 UnityFramework 0x00000001026cd6ac _ZN13MonoBehaviour22StartCoroutineManaged2E18ScriptingObjectPtr + 80
    15 UnityFramework 0x00000001027235dc _Z43MonoBehaviour_CUSTOM_StartCoroutineManaged2P37ScriptingBackendNativeObjectPtrOpaqueS0_ + 128
    16 UnityFramework 0x0000000102eca120 U3CU3Ec__DisplayClass150_0_U3ConGameOverU3Eb__0_m97B3C0FC4C774B98DE352911C351AB8012382313 + 200
    17 UnityFramework 0x0000000103370ebc Action_Invoke_m3FFA5BE3D64F0FF8E1E1CB6F953913FADB5EB89E + 276
    18 UnityFramework 0x0000000102eeef94 U3C_RunAfterU3Ed__9_MoveNext_mF2E703A10B65985BF33C24141FA9E8B4F7780B35 + 196
    19 UnityFramework 0x000000010326c32c SetupCoroutine_InvokeMoveNext_m036E6EE8C2A4D2DAA957D5702F1A3CA51313F2C7 + 196
    20 UnityFramework 0x0000000102251390 _Z89RuntimeInvoker_FalseVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5_RuntimeObject_IntPtr_tPFvvEPK10MethodInfoPvPS4_ + 28
    21 UnityFramework 0x0000000102de42a0 _ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException + 116
    22 UnityFramework 0x00000001026b67a8 _Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb + 124
    23 UnityFramework 0x00000001026c11c4 _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 120
    24 UnityFramework 0x00000001026cb2e0 _ZN9Coroutine14InvokeMoveNextEP21ScriptingExceptionPtr + 164
    25 UnityFramework 0x00000001026caecc _ZN9Coroutine3RunEPb + 52
    26 UnityFramework 0x0000000102554d6c _ZN18DelayedCallManager6UpdateEi + 536
    27 UnityFramework 0x00000001025ef3ac _Z17ExecutePlayerLoopP22NativePlayerLoopSystem + 88
    28 UnityFramework 0x00000001025ef3e0 _Z17ExecutePlayerLoopP22NativePlayerLoopSystem + 140
    29 UnityFramework 0x00000001025ef638 _Z10PlayerLoopv + 344
    30 UnityFramework 0x0000000102982a6c _ZL19UnityPlayerLoopImplb + 240
    31 UnityFramework 0x00000001021d9840 UnityRepaint + 140
    32 UnityFramework 0x00000001021d971c -[UnityAppController(Rendering) repaintDisplayLink] + 88
    33 QuartzCore 0x00000001a2049640 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 79424
    34 QuartzCore 0x00000001a211ba20 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 940576
    35 CoreFoundation 0x000000019ee6eb54 F3021642-E3C0-33F8-9911-DD303A6056D0 + 490324
    36 CoreFoundation 0x000000019ee92420 F3021642-E3C0-33F8-9911-DD303A6056D0 + 635936
    37 CoreFoundation 0x000000019ee91834 F3021642-E3C0-33F8-9911-DD303A6056D0 + 632884
    38 CoreFoundation 0x000000019ee8b9f4 F3021642-E3C0-33F8-9911-DD303A6056D0 + 608756
    39 CoreFoundation 0x000000019ee8aba0 CFRunLoopRunSpecific + 572
    40 GraphicsServices 0x00000001b5bf0598 GSEventRunModal + 160
    41 UIKitCore 0x00000001a177c2f4 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 11723508
    42 UIKitCore 0x00000001a1781874 UIApplicationMain + 164
    43 UnityFramework 0x00000001021d81d8 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 108
    44 OneMan 0x0000000100b1be1c main + 68
    45 libdyld.dylib 0x000000019eb69568 0B475C78-3C12-3121-B7F8-2B95B83DAF44 + 5480
    )
     
  2. francisIsFine

    francisIsFine

    Joined:
    Jun 26, 2018
    Posts:
    40
    Downgrading to Unity Ads 3.4.9 fixed the problem
     
  3. spilat12

    spilat12

    Joined:
    Feb 10, 2015
    Posts:
    38
    I am having the same issue...
     
  4. JindoBlu

    JindoBlu

    Joined:
    Mar 19, 2014
    Posts:
    22
    Starting from Unity Ads 3.7.0 package, If you are calling
    Advertisment.Show()
    make sure to pass as an argument to the method the placement id of the ad ("video" for interstitial or "rewardedVideo" for rewarded if you haven't changed the default id)

    So, I changed
    Advertisment.Show()
    to
    Advertisment.Show("video")
    and crash disappeared.

    Hope this helps
     
  5. spilat12

    spilat12

    Joined:
    Feb 10, 2015
    Posts:
    38
    I don't know who you are and where you got this info (because I can't find it anywhere and had no errors in my code), but you are my hero! Now the ads are playing again. I did start getting NullReferenceException after the ad is finished, though, but at least I got some progress now... Thanks!!
     
  6. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    francisIsFine likes this.