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

Bug Android ANR Legacy Advertisements

Discussion in 'Unity Ads & User Acquisition' started by pixeldashbilling, Aug 31, 2023.

  1. pixeldashbilling

    pixeldashbilling

    Joined:
    Apr 19, 2017
    Posts:
    6
    We have just released our updated application now using Unity Ads (Advertisement Legacy 4.4.2), however we are seeing a significant number of ANRs reported by Google Play with the following stack trace which seems to stem from onUnityAdsFailedToLoad. Is there any known solution to this?

     
    Last edited: Aug 31, 2023
  2. pixeldashbilling

    pixeldashbilling

    Joined:
    Apr 19, 2017
    Posts:
    6
    As an update here, we completely removed IUnityAdsLoadListener from our code and released a new build to Google Play. However, we are still getting this same ANR.
     
  3. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    597
    It seems that this problem occurs after the onUnityAdsFailedToLoad callback is called. Please check whether the application performs any operations in the onUnityAdsFailedToLoad callback method that may cause ANR.
     
  4. pixeldashbilling

    pixeldashbilling

    Joined:
    Apr 19, 2017
    Posts:
    6
    As I mentioned, we removed IUnityAdsLoadListener from our code and therefore passing null into all the Load() calls. Would this still call onUnityAdsFailedToLoad?

    If the ANR were in our application code, wouldn’t it be in the stack trace?

    I also found a related forum post that didn’t get a reply: https://forum.unity.com/threads/anr-at-onunityadsfailedtoload.1463177/
     
    Last edited: Sep 5, 2023
  5. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    597
    Would you be able to reproduce the ANR issue on your device? If so, could you please provide the device log so we can check it? Thanks.
     
  6. pixeldashbilling

    pixeldashbilling

    Joined:
    Apr 19, 2017
    Posts:
    6
  7. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    597
    I checked the stack trace and logs but didn't see anything related to "UnityAds". It seems the ANR issue in the stack trace isn't the same issue you mentioned before, can you confirm?
     
  8. pixeldashbilling

    pixeldashbilling

    Joined:
    Apr 19, 2017
    Posts:
    6
    The stack trace appears different, but this ANR happens also when loading a Unity Ad.
     
  9. unity_akeem

    unity_akeem

    Unity Technologies

    Joined:
    Apr 25, 2019
    Posts:
    20
    Hello, can you please file a ticket with our Support team by emailing unityads-support@unity3d.com. Also please include details from Google Play such as how often this ANR is occurring, devices it is occurring most on, OS data, etc.