Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

ANR because of AdMob (com.google.android.gms.policy_ads_fdr_dynamite)

174 views
Skip to first unread message

Yi Zheng

unread,
Jan 13, 2025, 4:25:08 PMJan 13
to Google Mobile Ads SDK Developers

I see lots of ANRs because of AdMob (com.google.android.gms.policy_ads_fdr_dynamite) in Google Play Console. The Google play service version is 23.0.0.

Is there anything I can do to resolve or work around this issue? Thanks.

I analyzed hundreds of the ANR report, I found the ANR seems happen often when main thread is waiting for something from a background worker thread.

This is what the worker thread usually look like:

com.google.android.gms.ads.identifier.b.run(:com.google.android.gms.policy_ads_fdr_dynamite@244410211@244410203017.691591528.691591528:7)","[thread='AdWorker(ClientDefault) #1' group='main' prio=5 tid=225 status=WAITING]

jdk.internal.misc.Unsafe.park(Unsafe.java:-2)

java.util.concurrent.locks.LockSupport.park(LockSupport.java:341)

java.util.concurrent.SynchronousQueue$TransferStack$SNode.block(SynchronousQueue.java:288)

java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3466)

java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3437)

java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:397)

java.util.concurrent.SynchronousQueue.take(SynchronousQueue.java:886)

java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1071)

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1131)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)


And the main thread usually look like this:

android.os.HandlerThread.run(HandlerThread.java:67)","[thread='main' group='main' prio=5 tid=2 status=WAITING]

java.lang.Object.wait(Object.java:-2)

java.lang.Object.wait(Object.java:405)

java.lang.Object.wait(Object.java:543)

android.opengl.GLSurfaceView$GLThread.onPause(GLSurfaceView.java:1733)

android.opengl.GLSurfaceView.onPause(GLSurfaceView.java:579)

com.someApp.core.GameActivity.onPause(GameActivity.java:228)

android.app.Activity.performPause(Activity.java:8549)

android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1589)

android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:5228)

android.app.ActivityThread.performPauseActivity(ActivityThread.java:5189)

android.app.ActivityThread.handlePauseActivity(ActivityThread.java:5141)

android.app.servertransaction.PauseActivityItem.execute(PauseActivityItem.java:47)

android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)

android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:178)

android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:99)

android.app.ActivityThread$H.handleMessage(ActivityThread.java:2423)

android.os.Handler.dispatchMessage(Handler.java:106)

android.os.Looper.loopOnce(Looper.java:201)

android.os.Looper.loop(Looper.java:288)

android.app.ActivityThread.main(ActivityThread.java:8115)

java.lang.reflect.Method.invoke(Method.java:-2)

com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:703)


BW,

Davis

1/13/25



Mobile Ads SDK Forum Advisor

unread,
Jan 13, 2025, 5:05:52 PMJan 13
to yi.z...@king.com, google-adm...@googlegroups.com
Hi,

Since you're encountering an ANR in your app, can you first confirm if you already checked this documentation guide Optimize initialization and ad loading and still was able to encounter an ANR? The guide mentioned that 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.

Kindly provide us full stack trace as it will give us a full overview of the issue at the core of the application.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGvkh:ref" (ADR-00284353)

Thanks,
 
Google Logo Mobile Ads SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5


 


Yi Zheng

unread,
Jan 16, 2025, 3:53:09 AMJan 16
to Google Mobile Ads SDK Developers
Yes, we added since 2023-Oct.

Mobile Ads SDK Forum Advisor

unread,
Jan 16, 2025, 7:35:14 AMJan 16
to yi.z...@king.com, google-adm...@googlegroups.com
Hi Davis, 

Thank for confirming that the two options are enabled.

In order to make progress on this issue we would require full stack trace, device type and a sample project reproducing the issue so that we can find the root cause and may provide the solution.

You can provide the following details via reply privately to the author option or this link 

Mayur Chauhan

unread,
Mar 24, 2025, 1:33:02 AMMar 24
to Google Mobile Ads SDK Developers
Issue Report for Google AdMob - Unity Game Crash
Subject: Unity Game Crash Due to Google Mobile Ads Blocking Main Thread

Description:
We are experiencing a major crash in our Unity-based mobile game (Fighter Pilot: CAS A-10) caused by Google Mobile Ads SDK blocking the main thread. The issue occurs in Google Play Services Ads (com.google.android.gms.policy_ads_fdr_dynamite), causing the main thread to freeze, followed by a Unity native crash in libunity.so.

Crash Details:
Game: Fighter Pilot:Heavy Fire
Unity Version: 2022.3.55f1 (LTS)
Google Mobile Ads SDK Version: [9.6.0]
Platform: Android
OS Version: Affects multiple Android versions (including Android 14)
Device Models: Various
Stack Trace (Relevant Parts):
Main Thread Blocked:

php
Copy
Edit
"main" tid=1 Blocked
  at m.avs.handleMessage (:com.google.android.gms.policy_ads_fdr_dynamite)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at m.bbd.a (:com.google.android.gms.policy_ads_fdr_dynamite)
  at m.bbd.dispatchMessage (:com.google.android.gms.policy_ads_fdr_dynamite)
  at android.os.Looper.loopOnce (Looper.java:233)
  at android.os.Looper.loop (Looper.java:344)
  at android.app.ActivityThread.main (ActivityThread.java:8249)
Unity Native Crash:

java
Copy
Edit
"UnityMain" tid=39 Native
  at jni::LocalScope::LocalScope()
  at DisplayListenerAvailable()
  at ScreenManagerAndroid::SetRequestedResolution()
  at ExecutePlayerLoop(NativePlayerLoopSystem*)
  at UnityPlayerLoop()
  at nativeRender(_JNIEnv*, _jobject*)
  at com.unity3d.player.UnityPlayer.nativeRender (Native method)
Issue Details & Observations:
Google Mobile Ads SDK is correctly initialized

We have enabled Optimize Initialization and Ad Loading.
Initialization completes successfully before requesting ads.
Main Thread Blocked in Play Services Ads Module

The crash occurs after an ad request.
The handleMessage() function in policy_ads_fdr_dynamite freezes the main thread.
Unity Display API Failure (Possible Conflict with AdMob)

ScreenManagerAndroid::SetRequestedResolution() crashes after the ad system blocks the main thread.
This may indicate a race condition between ad rendering and Unity's display system.
Steps to Reproduce:
Launch the game on an Android device.
Wait for the ad to load and display.
Game freezes, followed by a native crash.
What We Have Tried:
✅ Ensured correct SDK initialization (Optimize Initialization + Ad Loading).
✅ Updated Google Mobile Ads SDK to the latest version 9.6.0.
✅ Updated Unity to LTS version (2022.3.55f1).
✅ Tested on multiple devices and OS versions.
✅ Disabled ad loading and confirmed the crash does not happen.

Expected Behavior:
The game should not freeze or crash when loading or displaying ads.

Request for Assistance:
Is this a known issue with the latest Google Mobile Ads SDK?
Could there be a threading issue when handling ad events?
Any recommended fixes or workarounds to prevent the main thread from blocking?

I have attached the stack trace log for more info.
stacktrace.log

Mobile Ads SDK Forum Advisor

unread,
Mar 24, 2025, 4:25:17 AMMar 24
to ma...@threye.com, google-adm...@googlegroups.com

Hi,

I will check with the wider team and will reach out to you once we have an update on this. Meanwhile, your patience is highly appreciated.

Thanks,
 
Google Logo Mobile Ads SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-03-24 08:24:14Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02vGvkh:ref" (ADR-00284353)



Reply all
Reply to author
Forward
0 new messages