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 was completed 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 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.
The 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 did 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?
Do you have any recommended fixes or workarounds to prevent the main thread from blocking?
I have attached the stack trace log for more info.