Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/InterstitialAd

Discussion in 'General Discussion' started by sahilshjmu, Apr 8, 2021.

  1. sahilshjmu

    sahilshjmu

    Joined:
    Aug 18, 2017
    Posts:
    11
    Hello There,

    I am using Unity 2020.3.1f11.
    Google Mobile Ads 5.4.0 and Facebook Mediation plugin 3.2.0
    My Jar resolver is v1.2.164

    When i am building apk, it builds successful but when the Interstitial.loadAd(stringId) is called then it gets crashed and following is the log for this.

    04-08 16:41:06.939 11270 11270 I Unity : Adapter: com.google.android.gms.ads.MobileAds is initialized.
    04-08 16:41:06.939 11270 11270 I Unity :
    04-08 16:41:06.940 11270 11270 I Unity : Adapter: com.google.ads.mediation.vungle.VungleMediationAdapter not ready.
    04-08 16:41:06.940 11270 11270 I Unity :
    04-08 16:41:06.940 11270 11270 I Unity : Adapter: com.google.ads.mediation.applovin.AppLovinMediationAdapter not ready.
    04-08 16:41:06.940 11270 11270 I Unity :
    04-08 16:41:06.940 11270 11270 I Unity : Adapter: com.google.ads.mediation.adcolony.AdColonyMediationAdapter not ready.
    04-08 16:41:06.940 11270 11270 I Unity :
    04-08 16:41:06.940 11270 11270 I Unity : Adapter: com.google.ads.mediation.tapjoy.TapjoyMediationAdapter not ready.
    04-08 16:41:06.940 11270 11270 I Unity :
    04-08 16:41:09.134 11270 14222 E Unity : AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/InterstitialAd;
    04-08 16:41:09.134 11270 14222 E Unity : java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/InterstitialAd;
    04-08 16:41:09.134 11270 14222 E Unity : at java.lang.reflect.Executable.getMethodReturnTypeInternal(Native Method)
    04-08 16:41:09.134 11270 14222 E Unity : at java.lang.reflect.Method.getReturnType(Method.java:148)
    04-08 16:41:09.134 11270 14222 E Unity : at java.lang.Class.getDeclaredMethods(Class.java:1883)
    04-08 16:41:09.134 11270 14222 E Unity : at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:26)
    04-08 16:41:09.134 11270 14222 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    04-08 16:41:09.134 11270 14222 E Unity : at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
    04-08 16:41:09.134 11270 14222 E Unity : at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
    04-08 16:41:09.134 11270 14222 E Unity : at android.os.Handler.dispatchMessage(Handler.java:102)
    04-08 16:41:09.134 11270 14222 E Unity : at android.os.Looper.loop(Looper.java:246)
    04-08 16:41:09.134 11270 14222 E Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
    04-08 16:41:09.134 11270 14222 E Unity : Caused by: java.lang.ClassNotFoundException: com.google.android.gms.ads.InterstitialAd
    04-08 16:41:09.134 11270 14222 E Unity : ... 10 more
    04-08 16:41:09.134 11270 14222 E Unity : at UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.Strin

    I am struggling from last 2 days and have tried many many solutions like changing Versons, using force resolve etc but nothing is working for me.

    Any help would be highly appreciated.
     
unityunity