Search Unity

Android ANR [Input dispatching timed out] onUnityAdsReady

Discussion in 'Unity Ads & User Acquisition' started by Prophet1111, Dec 29, 2020.

  1. Prophet1111

    Prophet1111

    Joined:
    Mar 16, 2016
    Posts:
    24
    Hi,

    I've been struggling with this ANR when using Unity Ads.
    I'm using UnityAds both in AdMob mediation and natively as fallback ad source when mediation doesn't provide an ad. So I have both AdMob plugin and Monetization plugin in my project.

    It works in my other projects very well but in this new one I get many ANRs in Google Play that have "onUnityAdsReady" in the stack trace.

    I'm not doing anything in OnUnityAdsReady callback (empty method).

    Here's an ANR from Google Play:


     
  2. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    Which version of the SDK are you using? Do you have any full device logs from one of the ANRs?
     
  3. Prophet1111

    Prophet1111

    Joined:
    Mar 16, 2016
    Posts:
    24
    Is it possible that this happened because I did Initialize before registering listeners?


    I'm not sure what SDK version do I use. I've imported it from Asset Store few months back.

    I just have logs from Google Play.
     
  4. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    It's possible I suppose, but unlikely. We don't require people to use the standard listeners and there shouldn't be any errors if the SDK doesn't have any registered.

    The best thing you can do at this stage is update your SDK as there is a good chance the issue might go away. Unfortunately, without more concrete information about what is causing the ANRs there isn't much we can do.
     
  5. RGV

    RGV

    Joined:
    Jan 25, 2016
    Posts:
    48
    We got gigantic anr spikes since mid december, supposedly also related with ads. Is it something known now?
     
  6. Prophet1111

    Prophet1111

    Joined:
    Mar 16, 2016
    Posts:
    24
    @RGV I did not find a solution for this issue.
    Half of my game's ANRs are linked with this issue (onUnityAdsReady listner)

     
  7. unitynosf

    unitynosf

    Joined:
    Jun 9, 2014
    Posts:
    23
    Same here, just to pinch in. Since it's fairly new topic.
    Since Dec - it's been up crazy, like double. Latest GoogleMobileAds SDK used here, (https://github.com/googleads/googleads-mobile-unity/releases/tag/v5.4.0) - no mediation, just admob.

    I see a lot of these to be on Android 8.1, coming from google ads. Also with peers, I see even higher numbers.
    Already sent email to Google Play about this, since vitals are some of core KPI for store performance - yet no reply.
    I also just sent AdMob email.

    I am unable to read out those crash logs in a way for them to make sense, sadly, so if anyone is technical enough to understand exceptions and posts here over time, would be cool.
     
  8. Prophet1111

    Prophet1111

    Joined:
    Mar 16, 2016
    Posts:
    24
    Recently I removed AdMob completely (using different mediation instead), and problem is still there.

    In the next few days I'm planing to remove Unity Ads too to see if it helps (I'm using Unity Ads as backup if mediation does not have ad ready).
     
  9. EnJenGames

    EnJenGames

    Joined:
    Dec 25, 2015
    Posts:
    11
    I would just like to second this. Since mid december, ANRs went up, without doing any updates - and it went up for my peers too. Android 8.1 is the main source of it, as ANRs happen at at least 5 times the rate of any other android version.

    As a way to stay below the bad behavious threshold untill we find a fix for this - does anyone know if it is possible to exclude android 8.1 users from downloading the apps?

    Edit: This being a problem specifically with android 8.1, makes me wonder if the problem might be the Android Go Edition?
     
  10. unity_9460FB1EA99EC1823D00

    unity_9460FB1EA99EC1823D00

    Joined:
    Aug 3, 2021
    Posts:
    12
    I am also facing lots of ANRs

    Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 54. Wait queue head age: 10475.9ms.)

    I have seen on some forums that main thread block causes this issue. the point is, when my game is running smooth without any lag and frames drops then why main thread gets block. if some body knows any thing regarding this issue please share with me.
    I am using admob unity and firebase sdks.
    is there any way to run ads in a separate thread? is it safe and logical to do this?
    @kyle-unity i can share further details required to solve this
     
  11. SimonasKuzma

    SimonasKuzma

    Joined:
    Mar 23, 2022
    Posts:
    1
    @unity_9460FB1EA99EC1823D00
    Hey, do you have any news or additional information regarding this?
     
  12. Ashar01

    Ashar01

    Joined:
    Aug 1, 2014
    Posts:
    6
    Avoid using Awake() too much use Start() instead. Doing this my ANR's dropped from 0.7% to 0.19%

    Use Awake() in just one script per scene.

    Me myself was facing the increasing ANR's issue and I got them reduced from 0.7% to 0.19% just by replacing Awake() by Start()