Search Unity

game crashes when running ads reward callback

Discussion in 'Unity Ads & User Acquisition' started by yaseersanni, Dec 18, 2019.

  1. yaseersanni

    yaseersanni

    Joined:
    Jul 23, 2017
    Posts:
    4
    my game crashes each time i run google mobile ads on my unity game. it doesn't crash when i try watching the ad but it closes when i'm firing the reward call back for google mobile ads. help
    i have attached a file containing the log of the behavior of the app when i run the ads and the code snippets of my ads implementation. if there is any suggestion on what could possibly help please do post or if there's some kind of setting in unity i should turn on or off in unity before building please post. i really need any kind of help i can get. Thanks
     

    Attached Files:

  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @yaseersanni

    This support forum is typically for the Unity Ads network, so I don't have much expertise on Google Mobile Ads issues.

    Taking a look at the files you provided, the log doesn't contain much, but a full device log might show more information.

    In the HandleRewardBasedVideoRewarded method, you are referencing a GM variable. I assume this is a game manager singleton / static reference. Does the crash only happen when you modify the GM.money variable?

    If so, then the rewarded callback might be happening on a different thread, so that might cause a crash. You could test this by getting the Thread ID (Thread.CurrentThread.ManagedThreadId).

    If that doesn't help, I would recommend reaching out to their support team.
    https://support.google.com/google-ads/gethelp