Admob 7.0.1 with Mediation have App Crash
[REQUIRED] Step 1: Describe your environment
- Unity version: 2021.3.2f1
- Google Mobile Ads Unity plugin version: 7.0.1
- Platform: Android
- Platform OS version: Android 12
- Any specific devices issue occurs on:
- Mediation ad networks used, and their versions: Facebook Mediation 3.6.1
[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
App is crashed when using mediation (Facebook and UnityAds also)
Log Cat
2022-05-27 18:00:23.820 19645-19711/? E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.gms.ads.mediation.admob.AdMobExtras java.lang.ClassNotFoundException: com.google.android.gms.ads.mediation.admob.AdMobExtras at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:454) at com.unity3d.player.UnityPlayer.nativeRender(Native Method) at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0) at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20) Caused by: java.lang.ClassNotFoundException: com.google.android.gms.ads.mediation.admob.AdMobExtras at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:454) at com.unity3d.player.UnityPlayer.nativeRender(Native Method) at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0) at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20) at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.AndroidJNISafe.FindClass (System.String name) [0x00000] in <00000000000000000000000000000000>
Relevant Code:
// TODO(you): code here to reproduce the problem
Latest AdMob SDK doesn't seem to be compatible with com.google.android.gms:play-services-ads:21.0.0 (or any play-services-xxx:21.0.0, not sure where deprecated AdMobExtras was removed from)
I fixed it by forcing v20.6.0: com.google.android.gms:play-services-ads:[20.6.0]
@dhamelin we will release an update with Android V21 support shortly.
I solved this problem by changing this line into GoogleMobileAdsDependencies.xml
<androidPackage spec="com.google.android.gms:play-services-ads:20.6.0">
to this line
<androidPackage spec="com.google.android.gms:play-services-ads:[20.6.0]">
@dhamelin we will release an update with Android V21 support shortly.
Hi @NVentimiglia , This issue is happening even if we don't have mediation in place.We are using only Admob in our app without mediation. Issue occurs when we upgrade to playservices ads to 21.0.0 and compile.

Do you have any timelines for this update? so that we can plan our app release accordingly. We are eagerly waiting to update to 21.0.0 version to use new ANR optimisation flags added as part of the latest release.
Please let us know if there is any other way to circumvent this error while you are working on the fix. Thanks for looking in to this.
I have this problem only when I put the facebook adapter on. It changes all my dependency.
I did this:
<androidPackage spec="com.google.android.gms:play-services-ads:[20.6.0]">
But it doesn't matter, I still have the error
2022-05-27 18:00:23.820 19645-19711/? E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.gms.ads.mediation.admob.AdMobExtras
So the other mediation works, any ideas for Facebook?
@dhamelin we will release an update with Android V21 support shortly.
@NVentimiglia thanks for quick update and we are able to integrate the new plugin without any issue.Much appreciated.
Since there were no recent activities for this issue, we are therefore reluctantly going to close this bug for now.
If you are still experiencing the problem, please file a new issue with the same description, what happens and system / network tracing / Charles logs.
All system setups can be slightly different, so it's always better to open new issues and reference the related ones. Thanks for your contribution.