Getting this error on initialisation of admob
06-13 18:55:53.191 11424 11458 E Unity : AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzkj;
06-13 18:55:53.191 11424 11458 E Unity : java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzkj;
06-13 18:55:53.191 11424 11458 E Unity : at com.google.android.gms.internal.zzlc.<init>(Unknown Source:12)
06-13 18:55:53.191 11424 11458 E Unity : at com.google.android.gms.internal.zzlc.<clinit>(Unknown Source:9)
06-13 18:55:53.191 11424 11458 E Unity : at com.google.android.gms.internal.zzlc.zzik(Unknown Source:0)
06-13 18:55:53.191 11424 11458 E Unity : at com.google.android.gms.internal.zzmz.zza(Unknown Source:22)
06-13 18:55:53.191 11424 11458 E Unity : at com.google.android.gms.ads.MobileAds.initialize(Unknown Source:7)
06-13 18:55:53.191 11424 11458 E Unity : at com.google.android.gms.ads.MobileAds.initialize(Unknown Source:1)
06-13 18:55:53.191 11424 11458 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
06-13 18:55:53.191 11424 11458 E Unity : at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
06-13 18:55:53.191 11424 11458 E Unity : at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
06-13 18:55:53.191 11424 11458 E Unity : at android.os.MessageQueue.next(MessageQueue.java:394)
06-13 18:55:53.191 11424 11458 E Unity : at android.os.Looper.loop(Looper.java:142)
06-13 18:55:53.191 11424 11458 E Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
06-13 18:55:53.191 11424 11458 E Unity : Caused by: java.lang.ClassNotFoundException: com.google.android.gm
Other Plugins Used:
Things that I've already tried:
1) Resolve Jars
2) Reimport all my plugins
again same here
same here
same here with v3.13.1, this causes a crash at launch just after splash screen for me
I had the same problem after upgrading to the newest Unity Firebase (FCM and Analytics). It looked like a conflict with different versions of Play Services components. I was able to fix it by changing Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml, to use v15.0.1 of play services ads (instead of 12.0.1):
...
<androidPackage spec="com.google.android.gms:play-services-ads:15.0.1">
...
I don't know if this is the proper way of fixing it, so I can't guarantee it won't cause other problems, but so far it has worked for me without problems.
@Mitnainartinarian that worked like a charm, thanks! I will still be on my toes about this topic though.
@Mitnainartinarian, that seemed to solve the problem for me, Thanks a lot
The upcoming release for this plugin will update the dependencies file to use the latest version of the Google Mobile Ads SDK, which will resolve this issue.
Closing as this has been resolved in the latest version of this plugin.
Most helpful comment
I had the same problem after upgrading to the newest Unity Firebase (FCM and Analytics). It looked like a conflict with different versions of Play Services components. I was able to fix it by changing Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml, to use v15.0.1 of play services ads (instead of 12.0.1):
I don't know if this is the proper way of fixing it, so I can't guarantee it won't cause other problems, but so far it has worked for me without problems.