Hi, I added Admob into my game and my test ads works on unity editor perfectly and ı don't get any error.
However when ı get build for my android device, Ads doesn't show and I get error for this line :
----------
this.interstitial = new InterstitialAd(adUnitId);
----------
And Error :
----------
AndroidJavaException: java.lang.ClassNotFoundException: com.google.unity.ads.UnityInterstitialAdCallback
java.lang.ClassNotFoundException: com.google.unity.ads.UnityInterstitialAdCallback
java.lang.Class.classForName(Native Method)
java.lang.Class.forName(Class.java:453)
com.unity3d.player.UnityPlayer.nativeRender(Native Method)
com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:207)
com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.unity.ads.UnityInterstitialAdCallback" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.YDMGames.SpeedJump-ynPejBOzfqyFoPjZJbTLfw==/base.apk"],nativeLibraryDirectories=[/data/app/com.YDMGames.SpeedJump-ynPejBOzfqyFoPjZJbTLfw==/lib/arm64, /data/app/com.YDMGames.SpeedJump-ynPejBOzfqyFoPjZJbTLfw==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:171)
java.lang.ClassLoader.loadClass(ClassLoader.java:379)
java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 8 more
UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNISafe.FindClass (System.String name) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaProxy..ctor (System.String javaInterface) (at <00000000000000000000000000000000>:0)
GoogleMobileAds.Android.InterstitialClient..ctor () (at <00000000000000000000000000000000>:0)
GoogleMobileAds.GoogleMobileAdsClientFactory.BuildInterstitialClient () (at <00000000000000000000000000000000>:0)
GoogleMobileAds.Api.InterstitialAd..ctor (System.String adUnitId) (at <00000000000000000000000000000000>:0)
AdmobScriptt.RequestInterstitial () (at <00000000000000000000000000000000>:0)
AdmobScriptt.Start () (at <00000000000000000000000000000000>:0)
↧