A lot of ANR while MobileAds.initialize()

593 views
Skip to first unread message

Yanis Biziuk

unread,
Jul 9, 2021, 8:36:30 AM7/9/21
to Google Mobile Ads SDK Developers
Version of lib 20.2.0

We have a lot of ANR reports in google play console
Most of all start from MobileAds.initialize

Of cource we call MobileAds.initialize(context) { status -> ... } from the main thread

sample stacks 

 at com.google.android.gms.internal.ads.zzfjl.get (zzfjl.java:21) at com.google.android.gms.ads.internal.util.zzj.zzM (zzj.java:2) at com.google.android.gms.ads.internal.util.zzj.zzn (zzj.java:1) at com.google.android.gms.internal.ads.zzeyd.zza (zzeyd.java:12) at com.google.android.gms.internal.ads.zzdps.<init> (zzdps.java:2) at com.google.android.gms.internal.ads.zzdpv.zzb (zzdpv.java:5) at com.google.android.gms.internal.ads.zzgdp.zzb (zzgdp.java:1) at com.google.android.gms.internal.ads.zzdpx.zzb (zzdpx.java:1) at com.google.android.gms.internal.ads.zzgdp.zzb (zzgdp.java:1) at com.google.android.gms.internal.ads.zzdrp.zzb (zzdrp.java:1) at com.google.android.gms.internal.ads.zzgdp.zzb (zzgdp.java:1) at com.google.android.gms.internal.ads.zzcmw.zzb (zzcmw.java:1) at com.google.android.gms.internal.ads.zzgdp.zzb (zzgdp.java:1) at com.google.android.gms.internal.ads.zzcmk.zzj (zzcmk.java:1) at com.google.android.gms.ads.internal.ClientApi.zzh (ClientApi.java:3) at com.google.android.gms.internal.ads.zzbas.zzc (zzbas.java:2) at com.google.android.gms.internal.ads.zzbax.zze (zzbax.java:2) at com.google.android.gms.internal.ads.zzbax.zzd (zzbax.java:9) at com.google.android.gms.internal.ads.zzbdy.zzw (zzbdy.java:3) at com.google.android.gms.internal.ads.zzbdy.zzb (zzbdy.java:8) at com.google.android.gms.ads.MobileAds.initialize (MobileAds.java:3) 
...

at com.google.android.gms.internal.ads.zzfjl.get (zzfjl.java:21) at com.google.android.gms.ads.internal.util.zzj.zzM (zzj.java:2) at com.google.android.gms.ads.internal.util.zzj.zzn (zzj.java:1) at com.google.android.gms.internal.ads.zzdro.zzt (zzdro.java:1) at com.google.android.gms.internal.ads.zzdro.zzc (zzdro.java:10) at com.google.android.gms.internal.ads.zzcmv.zze (zzcmv.java:5) at com.google.android.gms.internal.ads.zzbdy.zzb (zzbdy.java:11) at com.google.android.gms.ads.MobileAds.initialize (MobileAds.java:3) 
...

Is it allowed to init library from another than the main thread?

Mobile Ads SDK Forum Advisor

unread,
Jul 9, 2021, 5:19:19 PM7/9/21
to yanis....@veraxen.com, google-adm...@googlegroups.com
Hi Yanis,

Thank you for reaching out to us with your concern. In seeing the logs, can you share with us via "Reply to Author" with a simple sample app that is able to reproduce this? As well as any steps that you have seen that can cause this issue.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2JZya4:ref

Yanis Biziuk

unread,
Jul 12, 2021, 3:12:45 AM7/12/21
to Google Mobile Ads SDK Developers
It's very difficult to reproduce it, this ANRs I only see in google play console. Usually, this ANR is happening with `slow` devices.
I can see that zzfjl.java (get) method should work with not a main thread. This is a root of the problem I think.

Mobile Ads SDK Forum Advisor

unread,
Jul 12, 2021, 5:53:29 AM7/12/21
to yanis....@veraxen.com, google-adm...@googlegroups.com
Hi there,

I'm afraid that we're left with not much of an option here as we'll need a detailed debug information from a device where it's observed in order to actually make any progress in diagnosing this. The only way for us to investigate further is by reproducing the issue locally. Could you provide the following details as well via Reply to author or a direct, private reply to mobileads...@gmail.com?
  • App ID
  • Ad Unit ID
  • Affected devices
  • occurrence percentage of the ANR
Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2JZya4:ref

Yanis Biziuk

unread,
Jul 16, 2021, 2:37:28 AM7/16/21
to Google Mobile Ads SDK Developers
I have tested with 19.6.0 version of ads, and no problem with ANR!

Mobile Ads SDK Forum Advisor

unread,
Jul 16, 2021, 6:12:01 AM7/16/21
to yanis....@veraxen.com, google-adm...@googlegroups.com

Hello Yanis,

Thank you for reaching out to us.

I work with Teejay and William and will be assisting you on this. Like my colleague mentioned, if you can provide us the following, we can better investigate your concern. You can send it via Reply privately to author option or send it directly to mobileads...@gmail.com? Kindly inform us on this thread if you sent it directly to the email provided.

    • App ID
    • Ad Unit ID
    • Affected devices
    • Occurrence percentage of the ANR

    Regards,

    Google Logo
    Princess Pamela Pineda
    Mobile Ads SDK Team
     


    ref:_00D1U1174p._5004Q2JZya4:ref

    Yanis Biziuk

    unread,
    Jul 20, 2021, 5:37:48 AM7/20/21
    to Google Mobile Ads SDK Developers
    @mobileadssdk I have sent info to provided email 

    Mobile Ads SDK Forum Advisor

    unread,
    Jul 20, 2021, 4:55:51 PM7/20/21
    to yanis....@veraxen.com, google-adm...@googlegroups.com
    Hi Yannis,

    Thank you for sending over the additional information. I was able to download the sample app and run it. While I do not see the error messages that you showed. I do in fact see errors which I have included for you to look over. From what I have seen regarding things similar to this. It would look like the way you are setting the redirect from the XML is not set up properly. So you are going to get crashes from that. When looking at the R type error with the URL cookies question is what I believe is causing the possible issue.

    Regards,

    Google Logo
    William Pescherine
    Mobile Ads SDK Team
     


    ref:_00D1U1174p._5004Q2JZya4:ref

    Mikhail Trushkevich

    unread,
    Jul 21, 2021, 3:04:49 AM7/21/21
    to Google Mobile Ads SDK Developers
    Hi William,
    We haven't send any sample app. Can you please clarify what exactly did you check?

    Mikhail Trushkevich
    Android Lead | Veraxen

    Mobile Ads SDK Forum Advisor

    unread,
    Jul 21, 2021, 10:08:40 AM7/21/21
    to mikhail.t...@veraxen.com, google-adm...@googlegroups.com
    Hi Mikhail,

    Thank you for the response. In looking back over the messages. I did see your response with the attached files. But, I have to apologize as I also saw another user regarding an issue that was similar to yours in our emails and mistook it as yours. Once we get the sample we will test it further and see what we can find.

    Omar Soussa

    unread,
    Jul 22, 2021, 11:14:14 AM7/22/21
    to Google Mobile Ads SDK Developers

    Hi William,

    Just to reiterate on Mikhail's initial point, obviously the main problem is high ANR rate. I think Mikhail sent a Stack trace for ANRs, will this be sufficient or do we require additional information.

    Omar Soussa

    unread,
    Aug 4, 2021, 9:32:37 AM8/4/21
    to Google Mobile Ads SDK Developers
    Hi Team, 

    Do we have any update on this open case?

    Thanks,
    Omar

    Mobile Ads SDK Forum Advisor

    unread,
    Aug 4, 2021, 11:54:31 AM8/4/21
    to google-adm...@googlegroups.com
    Hi Omar,

    I work with William and will assist you. I brought this to my team and we will get back to you as soon as possible. To help solve this, could you give us a sessions per ANR ratio, devices and OS versions this is occurring on and full traces of all threads?

    Regards,

    Google Logo
    Aryeh Baker
    Mobile Ads SDK Team
     


    ref:_00D1U1174p._5004Q2JZya4:ref

    Mobile Ads SDK Forum Advisor

    unread,
    Nov 22, 2022, 2:40:18 AM11/22/22
    to google-adm...@googlegroups.com

    Hi,

     

    I hope you're doing well.

     

    I just want to circle back on this. Can you confirm if you're able to turn the initialization optimization flag? If you haven't yet tried it, we suggest to use it as it mentioned that starting from Google Mobile Ads (GMA) SDK version 21.0.0, you can enable optimized SDK initialization and ad loading to improve the overall responsiveness of ads and help prevent "Application Not Responding" (ANR) errors on your app.

     

    Regards,

    Google Logo
    Princess Pamela
    Mobile Ads SDK Team
     


    ref:_00D1U1174p._5004Q2JZya4:ref
    Reply all
    Reply to author
    Forward
    0 new messages