MobileAds.initialize causes much more ANRs.

5,748 views
Skip to first unread message

griffith100...@gmail.com

unread,
Jun 6, 2018, 5:20:56 PM6/6/18
to Google Mobile Ads SDK Developers
Can MobileAds.initialize be called on a worker thread to prevent from the following ANR?
Or initialize must be called on the Main thread?

FYI

- targetSdkVersion 23
- Asus ZenPad 7.0 (Z370KL)(P002_2), 2048MB RAM, Android 5.1

"main" prio=5 tid=1 Native
 
| group="main" sCount=1 dsCount=0 obj=0x73a85000 self=0xb8fddfa8
 
| sysTid=19430 nice=-4 cgrp=default sched=0/0 handle=0xb6fd8bec
 
| state=S schedstat=( 1092515842 330770336 1728 ) utm=58 stm=51 core=0 HZ=100
 
| stack=0xbe6cd000-0xbe6cf000 stackSize=8MB
 
| held mutexes=
 
#00  pc 000000000003a6b0  /system/lib/libc.so (__ioctl+8)
 
#01  pc 000000000003f829  /system/lib/libc.so (ioctl+14)
 
#02  pc 000000000001cb3b  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+138)
 
#03  pc 000000000001d147  /system/lib/libbinder.so (android::IPCThreadState::waitForResponse(android::Parcel*, int*)+42)
 
#04  pc 000000000001d2e9  /system/lib/libbinder.so (android::IPCThreadState::transact(int, unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+124)
 
#05  pc 00000000000185c3  /system/lib/libbinder.so (android::BpBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+30)
 
#06  pc 00000000000841eb  /system/lib/libandroid_runtime.so (???)
 
#07  pc 0000000000d36755  /system/framework/arm/boot.oat (Java_android_os_BinderProxy_transactNative__ILandroid_os_Parcel_2Landroid_os_Parcel_2I+144)
  at android
.os.BinderProxy.transactNative (BinderProxy.java)
  at android
.os.BinderProxy.transact (BinderProxy.java:496)
  at android
.os.IUserManager$Stub$Proxy.getApplicationRestrictions (IUserManager.java:817)
  at android
.os.UserManager.getApplicationRestrictions (UserManager.java:1311)
  at org
.chromium.policy.AppRestrictionsProvider.getApplicationRestrictions (AppRestrictionsProvider.java:7)
  at org
.chromium.policy.AbstractAppRestrictionsProvider.refresh (AbstractAppRestrictionsProvider.java:14)
  at org
.chromium.policy.CombinedPolicyProvider.linkNative (CombinedPolicyProvider.java:9)
  at org
.chromium.content.browser.BrowserStartupController.nativeFlushStartupTasks (BrowserStartupController.java)
  at org
.chromium.content.browser.BrowserStartupController.flushStartupTasks (BrowserStartupController.java:10)
  at org
.chromium.android_webview.AwBrowserProcess$$Lambda$0.run (AwBrowserProcess.java:56)
  at org
.chromium.base.ThreadUtils.runOnUiThreadBlocking (ThreadUtils.java:10)
  at com
.android.webview.chromium.WebViewChromiumAwInit.startChromiumLocked (WebViewChromiumAwInit.java:63)
  at com
.android.webview.chromium.WebViewChromiumAwInit.ensureChromiumStartedLocked (WebViewChromiumAwInit.java:135)
  at com
.android.webview.chromium.WebViewChromiumAwInit.startYourEngines (WebViewChromiumAwInit.java:116)
- locked <@addr=0x1313e610> (a java.lang.Object)
  at com
.android.webview.chromium.WebViewChromiumFactoryProvider.startYourEngines (WebViewChromiumFactoryProvider.java:149)
  at com
.android.webview.chromium.WebViewChromium.init (WebViewChromium.java:34)
  at android
.webkit.WebView.<init> (WebView.java:554)
  at android
.webkit.WebView.<init> (WebView.java:489)
  at android
.webkit.WebView.<init> (WebView.java:472)
  at android
.webkit.WebView.<init> (WebView.java:459)
  at android
.webkit.WebView.<init> (WebView.java:449)
  at com
.google.android.gms.ads.internal.webview.u.<init> (u.java:1)
  at com
.google.android.gms.ads.internal.webview.q.call (q.java:5)
  at com
.google.android.gms.ads.internal.util.bs.a (bs.java:23)
  at com
.google.android.gms.ads.internal.webview.o.a (o.java:8)
  at com
.google.android.gms.ads.internal.js.q.<init> (q.java:7)
  at com
.google.android.gms.ads.internal.js.z.run (z.java:5)
  at com
.google.android.gms.ads.internal.util.future.ad.execute (ad.java:4)
  at com
.google.android.gms.ads.internal.js.y.a (y.java:17)
  at com
.google.android.gms.ads.internal.js.y.a (y.java:27)
- locked <@addr=0x12c0a0d0> (a java.lang.Object)
  at com
.google.android.gms.ads.internal.js.function.b.b (b.java:4)
  at com
.google.android.gms.ads.internal.ac.a (ac.java:55)
  at com
.google.android.gms.ads.internal.ac.a (ac.java:4)
  at com
.google.android.gms.ads.internal.ax.a (ax.java:55)
  at com
.google.android.gms.ads.internal.client.bc.onTransact (bc.java:42)
  at android
.os.Binder.transact (Binder.java:380)
  at com
.google.android.gms.internal.ads.zzej.transactAndReadExceptionReturnVoid (zzej.java)
  at com
.google.android.gms.internal.ads.zzll.zza (zzll.java)
  at com
.google.android.gms.internal.ads.zzmb.zza (zzmb.java)
- locked <@addr=0x12c0a110> (a java.lang.Object)
  at com
.google.android.gms.ads.MobileAds.initialize (MobileAds.java)
  at com
.google.android.gms.ads.MobileAds.initialize (MobileAds.java)




mobileadssdk-a...@google.com

unread,
Jun 7, 2018, 12:02:00 AM6/7/18
to griffith100...@gmail.com, Google Mobile Ads SDK Developers
Hi there,

Thanks for reaching out to us and providing helpful information.

As per this guide, please note that all calls to the Mobile Ads SDK such as the MobileAds.initialize() should be executed on the main thread and not in the background or worker thread.

In addition, I've tested this on my end and run the initialize() method on the main thread but I didn't encounter any ANRs. Could you try our sample apps and see if you still experience same issue?

Regards,
Steven Balan
Mobile Ads SDK Team

griffith100...@gmail.com

unread,
Jun 7, 2018, 2:17:55 AM6/7/18
to Google Mobile Ads SDK Developers
Hi,

Thank you for the reply!
Umm,,,"not in the background or worker thread."...OK.

Could you try our sample apps and see if you still experience same issue?
To my regret, ANRs cause on user's devices. (not on my device.)
So I cannot reproduce the problem.

Sincerely yours,
Mitsuaki


2018年6月7日木曜日 13時02分00秒 UTC+9 mobileadssdk-a...@google.com:

mobileadssdk-a...@google.com

unread,
Jun 7, 2018, 6:31:03 AM6/7/18
to griffith100...@gmail.com, Google Mobile Ads SDK Developers
Hi Mitsuaki,

Since you can't replicate this issue on your end, for further investigation, could you provide the following privately using the Reply privately to author option?
  • If available, Crashlytics or other crash reporting logs.
  • List of the devices that are affected by this issue aside from the Asus ZenPad that you've mentioned.

I.D.E.

unread,
Jun 9, 2018, 12:02:42 AM6/9/18
to Google Mobile Ads SDK Developers
I've also seen this issue a lot, over several years. It's detected by the ANR WatchDog library: https://github.com/SalomonBrys/ANR-WatchDog

It happens mostly on Android 4.x, and less often on Android 5.x, then 6.x.

It's noticeable on low-end devices, when the app stutters or becomes slightly unresponsive whilst the ad is being loaded.

It's mentioned here too: https://groups.google.com/forum/#!msg/google-admob-ads-sdk/Hi6AQVhwfE8/zJmXU9oXCAAJ  -- but I've tracked delays larger than 1.5 seconds.

griffith100...@gmail.com

unread,
Jun 9, 2018, 2:42:57 PM6/9/18
to Google Mobile Ads SDK Developers
Hi Steven,

Yesterday, I sent the logs (stack trace) with device lists.
Did you see it?

Sincerely yours,
Mitsuaki


2018年6月7日木曜日 19時31分03秒 UTC+9 mobileadssdk-a...@google.com:

mobileadssdk-a...@google.com

unread,
Jun 11, 2018, 2:28:56 AM6/11/18
to griffith100...@gmail.com, Google Mobile Ads SDK Developers
Hi there,

Thanks for providing logs and other helpful information privately.

I will raise this to the rest of the team and update this thread for any official feedback.

Juan María Clavería

unread,
Jul 13, 2018, 7:12:50 AM7/13/18
to Google Mobile Ads SDK Developers
Hi Steven,

I'm facing the same problem (coming from here). 

If it helps, this is a list of the mainly problem devices:

Y7 (HWTRT-Q) 6513,1%
P9 lite (HWVNS-H) 6212,5%
P8 lite 2017 (HWPRA-H) 479,5%
HUAWEI Y7 Prime 2018 (HWLDN-Q) 459,1%
Mate 10 lite (HWRNE) 336,7%
P10 lite (HWWAS-H) 285,7%
Honor 6A (HWDLI-Q) 204,0%
GT3 (HWNMO-H) 163,2%
MediaPad T3 7 (HWBG2) 142,8%
P9 Plus (HWVIE) 112,2%
v173_zkd_2f2 102,0%
荣耀畅玩7X (HWBND-H) 102,0%
HUAWEI Y6 2018 (HWATU-QG) 91,8%
荣耀9青春版 (HWLLD-H) 71,4%
FIG-LX1 (HWFIG-H) 71,4%
荣耀畅玩 6X (HWBLN-H) 71,4%
3632A-mpcs (cp3632a) 61,2%
Moto G (2nd Gen) (titan_udstv) 61,2%
E (E) 51,0%
Galaxy J1 Mini Prime (j1minive3g) 40,8%

These ANRs are critical for us, it represents the 80% of total ANRs of our app. Have passed from 99.9% to 99.8% ANR free :(

mobileadssdk-a...@google.com

unread,
Jul 13, 2018, 2:37:47 PM7/13/18
to Juan María Clavería, Google Mobile Ads SDK Developers
Hi there,

Thanks for sharing the additional details. I'll update this thread if I have any new information form the team.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Juan María Clavería

unread,
Jul 20, 2018, 5:34:12 PM7/20/18
to Google Mobile Ads SDK Developers
Hi there.

Is there any news about this?

I am aware that the error is being investigated but more and more threads of users with the same problem appear in the group.
The biggest drawback of this error is that it is affecting too much the KPIs ​​of "Android Vitals", also to have the right KPIs ​​again, you have to wait 60 days since the problem is solved (Android Vitals takes the last 60 days reports).

Is there anything we could do to help solving this?

Thanks in advance

mobileadssdk-a...@google.com

unread,
Jul 23, 2018, 2:56:25 PM7/23/18
to Juan María Clavería, Google Mobile Ads SDK Developers
Hi Juan,

Our team is investigating the issue. But can you please confirm that you are seeing the issue on the latest version of SDK? I will also make sure to update you via this thread as soon as I have any new information from the team.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/0329ba71-1c00-4dee-af77-b2d350f89835%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Juan María Clavería

unread,
Aug 13, 2018, 8:50:10 AM8/13/18
to Google Mobile Ads SDK Developers
Updated to the last version (3.15.0) and still getting the same ANRs. It's very frustrating :( We are thinking about replacing AdMob with UnityAds although the eCPM is lower, we can't reach the 99.9% free of ANRs with this problem

mobileadssdk-a...@google.com

unread,
Aug 13, 2018, 3:21:05 PM8/13/18
to Juan María Clavería, Google Mobile Ads SDK Developers
Hi Juan,

The issue has been fixed with the latest release. But, we have still got reports from few publishers who are seeing the issue with the latest plugin. I've already shared this with the team for further investigation. But, however, can you please share the latest logs to share with the team? 

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 08/13/18 08:50:10 jmcla...@gmail.com wrote:
Updated to the last version (3.15.0) and still getting the same ANRs. It's very frustrating :( We are thinking about replacing AdMob with UnityAds although the eCPM is lower, we can't reach the 99.9% free of ANRs with this problem

El lunes, 23 de julio de 2018, 20:56:25 (UTC+2), mobileadssdk-a...@google.com escribió:
Hi Juan,

Our team is investigating the issue. But can you please confirm that you are seeing the issue on the latest version of SDK? I will also make sure to update you via this thread as soon as I have any new information from the team.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 07/20/18 17:34:12 jmcla...@gmail.com wrote:
Hi there.

Is there any news about this?

I am aware that the error is being investigated but more and more threads of users with the same problem appear in the group.
The biggest drawback of this error is that it is affecting too much the KPIs ​​of "Android Vitals", also to have the right KPIs ​​again, you have to wait 60 days since the problem is solved (Android Vitals takes the last 60 days reports).

Is there anything we could do to help solving this?

Thanks in advance

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Juan María Clavería

unread,
Aug 14, 2018, 1:30:20 AM8/14/18
to Google Mobile Ads SDK Developers
Here it is:

"main" prio=5 tid=1 Blocked
  | group="main" sCount=1 dsCount=0 obj=0x76ac6000 self=0xe7504f00
  | sysTid=22346 nice=0 cgrp=default sched=0/0 handle=0xea2cb534
  | state=S schedstat=( 721037511 79970312 739 ) utm=54 stm=18 core=3 HZ=100
  | stack=0xff7d7000-0xff7d9000 stackSize=8MB
  | held mutexes=
  at com.google.android.gms.internal.ads.zzmb.zziv (unavailable)
- waiting to lock <0x0dc3253e> (a java.lang.Object) held by thread 19
  at com.google.android.gms.ads.MobileAds.getRewardedVideoAdInstance (unavailable)
  at com.google.unity.ads.RewardBasedVideo$1.run (RewardBasedVideo.java:65)
  at android.os.Handler.handleCallback (Handler.java:761)
  at android.os.Handler.dispatchMessage (Handler.java:98)
  at android.os.Looper.loop (Looper.java:156)
  at android.app.ActivityThread.main (ActivityThread.java:6531)
  at java.lang.reflect.Method.invoke! (Native method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:941)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:831)

"UnityMain" tid=19 Waiting 
"UnityMain" prio=5 tid=19 Waiting
  | group="main" sCount=1 dsCount=0 obj=0x12c0a1a0 self=0xd8c4fe00
  | sysTid=22380 nice=0 cgrp=default sched=0/0 handle=0xbf486920
  | state=S schedstat=( 2491097933 30215094 1374 ) utm=230 stm=19 core=6 HZ=100
  | stack=0xbf384000-0xbf386000 stackSize=1038KB
  | held mutexes=
  at java.lang.Object.wait! (Native method)
- waiting on <0x0abe2984> (a java.lang.Object)
  at wY.b (SourceFile:177)
  at wY.d (SourceFile:190)
- locked <0x0abe2984> (a java.lang.Object)
  at com.android.webview.chromium.WebViewChromiumFactoryProvider.getStatics (SourceFile:187)
- locked <0x0abe2984> (a java.lang.Object)
  at android.webkit.WebSettings.getDefaultUserAgent (WebSettings.java:1246)
  at android.os.Binder.transact (Binder.java:499)
  at com.google.android.gms.internal.ads.zzej.transactAndReadExceptionReturnVoid (unavailable)
  at com.google.android.gms.internal.ads.zzll.zza (unavailable)
  at com.google.android.gms.internal.ads.zzmb.zza (unavailable)
- locked <0x0dc3253e> (a java.lang.Object)
  at com.google.android.gms.ads.MobileAds.initialize (unavailable)
  at com.google.android.gms.ads.MobileAds.initialize (unavailable)
  at com.unity3d.player.UnityPlayer.nativeRender (Native method)
  at com.unity3d.player.UnityPlayer.c (unavailable)
  at com.unity3d.player.UnityPlayer$e$2.queueIdle (unavailable)
  at android.os.MessageQueue.next (MessageQueue.java:456)
  at android.os.Looper.loop (Looper.java:138)
  at com.unity3d.player.UnityPlayer$e.run (unavailable)

mobileadssdk-a...@google.com

unread,
Aug 14, 2018, 3:13:25 PM8/14/18
to Juan María Clavería, Google Mobile Ads SDK Developers
Hi Juan,

Thanks for sending the logs. I'll keep you updated via this thread if I have any new information from the team.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Here it is:

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Juan María Clavería

unread,
Aug 22, 2018, 4:02:10 AM8/22/18
to Google Mobile Ads SDK Developers
Hi, I know it just been 8 days since my last message but, any news with this? My publisher insists on fix this problem and I can't provide any solution. Anyone knows a previous build without this error? If there is a chance to downgrade the library to avoid this error I would do it right now!

mobileadssdk-a...@google.com

unread,
Aug 22, 2018, 2:58:31 PM8/22/18
to Juan María Clavería, Google Mobile Ads SDK Developers
Hi Juan,

We understand your urgency. But, we don't have any update to share with you at this moment.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Sleepers Tang

unread,
Sep 4, 2018, 9:48:56 AM9/4/18
to Google Mobile Ads SDK Developers
I guess the problem is that I load interstitial and reward video ads at the same time (ie. in consecutive line of code).
 My work around is separate those two functions in different frames (since my app is a game, which is delay execution in 16ms), and the ANR walks away. 

pesudo-code:
    -- main thread,
    -- bla bla,
       
       load_intersitial_ads();
      execute_in_next_frame( function() {
           load_reward_video_ads();
      });

Hope this could save your day, :)

Giru bhai

unread,
Jan 15, 2021, 12:40:53 AM1/15/21
to Google Mobile Ads SDK Developers
Still too much ANRs by calling

========== 
Code
========== 

MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {

}
});

==========
ANR 
==========  

  #00  pc 000000000008003c  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
  #00  pc 000000000014b0e0  /apex/com.android.runtime/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+136)
  #00  pc 00000000003bccf8  /apex/com.android.runtime/lib64/libart.so (art::JNI::NewString(_JNIEnv*, unsigned short const*, int)+544)
  #00  pc 00000000020bbe64  /data/app/com.google.android.webview-eRNuBJS_5mhFFHyNXL-VFQ==/base.apk!libmonochrome.so (???)
  at J.N.MFiR_zHY (N.java)
  at org.chromium.android_webview.AwContents.<init> (AwContents.java:67)
  at Wh.run (Wh.java:9)
  at wN.b (wN.java:3)
  at uN.run (uN.java:1)
  at org.chromium.base.task.PostTask.c (PostTask.java:3)
  at wN.a (wN.java:3)
  at com.android.webview.chromium.WebViewChromium.init (WebViewChromium.java:70)
  at android.webkit.WebView.<init> (WebView.java:429)
  at android.webkit.WebView.<init> (WebView.java:353)
  at android.webkit.WebView.<init> (WebView.java:336)
  at android.webkit.WebView.<init> (WebView.java:323)
  at android.webkit.WebView.<init> (WebView.java:313)
  at com.google.android.gms.ads.internal.webview.s.a (s.java)
  at com.google.android.gms.ads.internal.util.bi.b (bi.java:3)
  at com.google.android.gms.ads.internal.webview.v.a (v.java:2)
  at com.google.android.gms.ads.internal.js.l.<init> (l.java:4)
  at com.google.android.gms.ads.internal.js.n.run (n.java)
  at com.google.android.gms.ads.internal.util.future.c.execute (c.java:2)
  at com.google.android.gms.ads.internal.util.future.d.execute (d.java)
  at com.google.android.gms.ads.internal.js.ai.b (ai.java:3)
  at com.google.android.gms.ads.internal.js.ai.a (ai.java:5)
  at com.google.android.gms.ads.internal.js.function.n.b (n.java)
  at com.google.android.gms.ads.internal.e.b (e.java:15)
  at com.google.android.gms.ads.internal.e.a (e.java)
  at com.google.android.gms.ads.nonagon.ao.g (ao.java:8)
  at fy.onTransact (fy.java:4)
  at android.os.Binder.transact (Binder.java:914)
  at com.google.android.gms.internal.ads.zzgu.zzb (zzgu.java)
  at com.google.android.gms.internal.ads.zzxy.zza (zzxy.java)
  at com.google.android.gms.internal.ads.zzxy.zza (zzxy.java)
  at com.google.android.gms.internal.ads.zzxy.zza (zzxy.java)
  at com.google.android.gms.internal.ads.zzxy.zza (zzxy.java)
  at com.google.android.gms.internal.ads.zzzd.zza (zzzd.java)
  at com.google.android.gms.internal.ads.zzzd.zza (zzzd.java)
  at com.google.android.gms.internal.ads.zzzd.zza (zzzd.java)
  at com.google.android.gms.internal.ads.zzzd.zza (zzzd.java)
  at com.google.android.gms.internal.ads.zzzd.zza (zzzd.java)
  at com.google.android.gms.internal.ads.zzzd.zza (zzzd.java)
  at com.google.android.gms.ads.MobileAds.initialize (MobileAds.java)
  at com.google.android.gms.ads.MobileAds.initialize (MobileAds.java)
  at com.google.android.gms.ads.MobileAds.initialize (MobileAds.java)
  at com.google.android.gms.ads.MobileAds.initialize (MobileAds.java)
  at com.myapp.appclass.initAdMobSDK (appclass.java)
  at com.myapp.appclass.onCreate (appclass.java)
  at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1190)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6500)
  at android.app.ActivityThread.access$1300 (ActivityThread.java:225)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1865)
  at android.os.Handler.dispatchMessage (Handler.java:107)
  at android.os.Looper.loop (Looper.java:359)
  at android.app.ActivityThread.main (ActivityThread.java:7418)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:935)

==========

Any solution ? how to call MobileAds.initialize function.

Mobile Ads SDK Forum Advisor Prod

unread,
Jan 15, 2021, 1:41:26 AM1/15/21
to girdha...@gmail.com, google-adm...@googlegroups.com

Hi Giru,

Thank you for reaching out to us.

This seems to be more of a concern with Android WebView than with the AdMob SDK, judging by the stack trace (i.e. WebView occupies the few latest lines in the trace). Could you kindly try the following to see if it would alleviate the issue?

WebView webView = new WebView(this);
MobileAds.initialize(...);

 

Google Logo
Ziv Yves Sanchez
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2B0XgK:ref

Giru bhai

unread,
Jan 15, 2021, 2:13:59 AM1/15/21
to Google Mobile Ads SDK Developers

Thanks for your prompt response.

But in stacktrace MobileAds.initialize also appear.

And any reason to using 

WebView webView = new WebView(this); 
before MobileAds.initialize(...);

Mobile Ads SDK Forum Advisor Prod

unread,
Jan 15, 2021, 4:34:18 AM1/15/21
to girdha...@gmail.com, google-adm...@googlegroups.com

Hi Giru,

To clarify, the AdMob SDK initializes WebView for ad-displaying purposes and, as per the stack trace you provided, it is WebView that is causing the ANR, not AdMob. The code snippet I provided should initialize WebView separately from AdMob, which should help in determining whether it is was WebView or AdMob that was truly causing the ANRs.
 

Giru bhai

unread,
Jan 15, 2021, 4:40:49 AM1/15/21
to Google Mobile Ads SDK Developers
Ok, thanks for the clarification. 

Will give it a try and let u know. 

Muhammad Zahid

unread,
May 18, 2021, 2:53:16 AM5/18/21
to Google Mobile Ads SDK Developers
App generating ANR 

#00 pc 00000000004a701c /apex/com.android.art/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+140) #00 pc 00000000005b6174 /apex/com.android.art/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+372) #00 pc 00000000005d3714 /apex/com.android.art/lib64/libart.so (art::DumpCheckpoint::Run(art::Thread*)+924) #00 pc 00000000005b70e0 /apex/com.android.art/lib64/libart.so (art::Thread::RunCheckpointFunction()+176) #00 pc 000000000067496c /apex/com.android.art/lib64/libart.so (art::JniMethodFastEnd(unsigned int, art::Thread*)+132) at sun.misc.Unsafe.unpark (Native method) at java.util.concurrent.locks.LockSupport.unpark (LockSupport.java:156) at java.util.concurrent.SynchronousQueue$TransferStack$SNode.tryMatch (SynchronousQueue.java:267) at java.util.concurrent.SynchronousQueue$TransferStack.transfer (SynchronousQueue.java:383) at java.util.concurrent.SynchronousQueue.offer (SynchronousQueue.java:909) at java.util.concurrent.ThreadPoolExecutor.execute (ThreadPoolExecutor.java:1386) at com.google.android.gms.ads.internal.util.future.d.execute (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010) at com.google.android.gms.ads.nonagon.ad.event.dj.y (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010) at com.google.android.gms.ads.nonagon.ad.event.fa.c (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010) at com.google.android.gms.ads.internal.activeview.f.c (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:32) at com.google.android.gms.ads.internal.activeview.b.run (unavailable) at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at qy.a (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010) at com.google.android.gms.ads.internal.util.f.a (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:1) at qy.dispatchMessage (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010) at android.os.Looper.loop (Looper.java:239) at android.app.ActivityThread.main (ActivityThread.java:8179) at java.lang.reflect.Method.invoke (Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:626) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1015)

Mobile Ads SDK Forum Advisor Prod

unread,
May 18, 2021, 5:25:54 AM5/18/21
to help.a...@gmail.com, google-adm...@googlegroups.com

Hi Muhammad,

Thank you for reaching out to us.

Could you please provide the following details via Reply privately to author option or send it directly to mobileads...@gmail.com?

  • Sample app(if any)
  • Steps to replicate
  • Device and version affected

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2B0XgK:ref

Oleg

unread,
May 24, 2021, 5:22:44 PM5/24/21
to Google Mobile Ads SDK Developers
Hi,

I just updated the app on Google Play with AdMob v.20.1.0
The app started to produce a huge amount of ANRs.
I'm thinking to rollback to v.19.8.0 which has no bugs (ANRs).
I can't reproduce it on my devices, but I see at Google Developer Console that problem related to:
1. Android 11.
2. A lot of Samsung devices.
3.  AdMob v.20.1.0.
ANRs started from sdk initialization at MobileAds.initialize and related to WebView.

#00 pc 00000000000d8b88 /apex/com.android.runtime/bin/linker64 (__dl_mprotect+8) #00 pc 000000000003df38 /apex/com.android.runtime/bin/linker64 (__dl__ZN20LinkerBlockAllocator11protect_allEi+40) #00 pc 000000000003728c /apex/com.android.runtime/bin/linker64 (__dl__Z16create_namespacePKvPKcS2_S2_mS2_P19android_namespace_t+2124) #00 pc 00000000000315b4 /apex/com.android.runtime/bin/linker64 (__loader_android_create_namespace+92) #00 pc 0000000000001060 /apex/com.android.runtime/lib64/bionic/libdl_android.so (android_create_namespace+12) #00 pc 000000000001a5a8 /apex/com.android.art/lib64/libnativeloader.so (android::NativeLoaderNamespace::Create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, android::NativeLoaderNamespace const*, bool, bool, bool)+536) #00 pc 000000000000f724 /apex/com.android.art/lib64/libnativeloader.so (android::nativeloader::LibraryNamespaces::Create(_JNIEnv*, unsigned int, _jobject*, bool, _jstring*, _jstring*, _jstring*)+2808) #00 pc 000000000000e174 /apex/com.android.art/lib64/libnativeloader.so (CreateClassLoaderNamespace+136) at com.android.internal.os.ClassLoaderFactory.createClassloaderNamespace (Native method) at com.android.internal.os.ClassLoaderFactory.createClassLoader (ClassLoaderFactory.java:120) at android.app.ApplicationLoaders.getClassLoader (ApplicationLoaders.java:114) at android.app.ApplicationLoaders.getClassLoaderWithSharedLibraries (ApplicationLoaders.java:60) at android.app.LoadedApk.createOrUpdateClassLoaderLocked (LoadedApk.java:932) at android.app.LoadedApk.access$100 (LoadedApk.java:119) at android.app.LoadedApk$SplitDependencyLoaderImpl.constructSplit (LoadedApk.java:636) at android.content.pm.split.SplitDependencyLoader.loadDependenciesForSplit (SplitDependencyLoader.java:70) at android.app.LoadedApk$SplitDependencyLoaderImpl.ensureSplitLoaded (LoadedApk.java:671) at android.app.LoadedApk$SplitDependencyLoaderImpl.getSplitPathsForSplit (LoadedApk.java:680) at android.app.LoadedApk.getSplitPaths (LoadedApk.java:697) at android.app.ContextImpl.createResources (ContextImpl.java:2349) at android.app.ContextImpl.createApplicationContext (ContextImpl.java:2392) at android.content.ContextWrapper.createApplicationContext (ContextWrapper.java:966) at android.webkit.WebViewFactory.getWebViewContextAndSetProvider (WebViewFactory.java:380) at android.webkit.WebViewFactory.getProviderClass (WebViewFactory.java:402) at android.webkit.WebViewFactory.getProvider (WebViewFactory.java:252) at android.webkit.WebView.getFactory (WebView.java:2576) at android.webkit.WebView.ensureProviderCreated (WebView.java:2570) at android.webkit.WebView.setOverScrollMode (WebView.java:2657) at android.view.View.<init> (View.java:5697) at android.view.View.<init> (View.java:5886) at android.view.ViewGroup.<init> (ViewGroup.java:715) at android.widget.AbsoluteLayout.<init> (AbsoluteLayout.java:59) at android.webkit.WebView.<init> (WebView.java:413) at android.webkit.WebView.<init> (WebView.java:355) at android.webkit.WebView.<init> (WebView.java:337) at android.webkit.WebView.<init> (WebView.java:324) at android.webkit.WebView.<init> (WebView.java:314) at com.google.android.gms.ads.internal.webview.ac.<init> (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:1) at com.google.android.gms.ads.internal.webview.s.a (unavailable:4) at com.google.android.gms.ads.internal.webview.v.a (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:5) at com.google.android.gms.ads.internal.js.l.<init> (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:3) at com.google.android.gms.ads.internal.js.n.run (unavailable:2) at com.google.android.gms.ads.internal.util.future.c.execute (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:2) at com.google.android.gms.ads.internal.util.future.d.execute (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010) at com.google.android.gms.ads.internal.js.ai.b (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:3) at com.google.android.gms.ads.internal.js.ai.a (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:5) at com.google.android.gms.ads.internal.js.function.n.b (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010) at com.google.android.gms.ads.internal.e.b (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:15) at com.google.android.gms.ads.internal.e.a (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010) at com.google.android.gms.ads.nonagon.as.g (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:8) at com.google.android.gms.ads.internal.client.bp.bA (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:23) at gd.onTransact (com.google.android.gms.policy_ads_fdr_dynamite@210890500@210890500057.359169010.359169010:4) at android.os.Binder.transact (Binder.java:1079) at com.google.android.gms.internal.ads.zzhw.zzbj at com.google.android.gms.internal.ads.zzabj.zzj at com.google.android.gms.internal.ads.zzacy.zzb at com.google.android.gms.ads.MobileAds.initialize

Mobile Ads SDK Forum Advisor Prod

unread,
May 25, 2021, 12:22:21 AM5/25/21
to tarashke...@gmail.com, google-adm...@googlegroups.com

Hi Oleg,

Thank you for reaching out to us.

Could you please provide the following details via Reply privately to author option or send it directly to mobileads...@gmail.com?

  • Sample app(if any)
  • Steps to replicate
  • Other Devices and version affected

Oleg

unread,
May 27, 2021, 3:44:38 PM5/27/21
to Google Mobile Ads SDK Developers
Hi, I have responded to this information via email, but I have not received any message or recommendation on what to do.
Please help, how to reduce ANR for apps?

This graph shows that after update to AdMob v.20.1.0 amount of ANRs started to grow up.

Screenshot 2021-05-27 at 22.41.27.png

Mobile Ads SDK Forum Advisor Prod

unread,
May 28, 2021, 12:38:54 AM5/28/21
to tarashke...@gmail.com, google-adm...@googlegroups.com

Hi Oleg,

Thank you for providing additional information to us.

Upon checking, we received reports from other publishers which seems to be the same issue as this one.  However, this issue seems to be a result of WebView.init() rather than the MobileAds.initialize(). As suggestion by the team, could you please try running the following code snippet and see if that would solve the issue on your end?

WebView webView = new WebView(this);
MobileAds.initialize(...);

Regards,

Message has been deleted

mianal...@gmail.com

unread,
Feb 3, 2023, 11:49:31 PM2/3/23
to Google Mobile Ads SDK Developers
Hi,

i am still facing this problem. i don't know why admob team is not taking it serious.

i am using: implementation 'com.google.android.gms:play-services-ads:21.4.0'

Mobile Ads SDK Forum Advisor

unread,
Feb 6, 2023, 9:12:25 AM2/6/23
to mianal...@gmail.com, google-adm...@googlegroups.com

Hello,

 

Thank you for reaching out to us.

 

Have you tried Optimize initialization and ad loading to fix the issue? If the issue still persists, kindly provide us the following information below privately for us to properly troubleshoot your issue:
 

  • Sample App
  • Steps to replicate
  • App ID
  • SDK Version
  • Complete Stack Trace Error
  • Device name and versions affected
 

You can provide the following details via reply privately to author option or directly provide it to the link below.

 

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

 

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002B0XgKQAV&entry.80707362=00056416

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

 

Regards,

Google Logo
Zoilo Isagani
Mobile Ads SDK Team
 


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