- Home /
Unity + Admob dependencies
Unity 17.3.1f1 Google Mobile Ads Unity Plugin v3.13.1
Whatever I do, Unity never finds the needed dependencies. Logcat always says:
05-31 05:51:10.040: E/Unity(4692): AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.gms.ads.MobileAds 05-31 05:51:10.040: E/Unity(4692): java.lang.ClassNotFoundException: com.google.android.gms.ads.MobileAds 05-31 05:51:10.040: E/Unity(4692): at java.lang.Class.classForName(Native Method) 05-31 05:51:10.040: E/Unity(4692): at java.lang.Class.forName(Class.java:308) 05-31 05:51:10.040: E/Unity(4692): at java.lang.Class.forName(Class.java:272) 05-31 05:51:10.040: E/Unity(4692): at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 05-31 05:51:10.040: E/Unity(4692): at com.unity3d.player.UnityPlayer.c(Unknown Source) 05-31 05:51:10.040: E/Unity(4692): at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source) 05-31 05:51:10.040: E/Unity(4692): at android.os.Handler.dispatchMessage(Handler.java:98) 05-31 05:51:10.040: E/Unity(4692): at android.os.Looper.loop(Looper.java:135) 05-31 05:51:10.040: E/Unity(4692): at com.unity3d.player.UnityPlayer$c.run(Unknown Source) 05-31 05:51:10.040: E/Unity(4692): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.MobileAds" on path: DexPathList[[zip file "/data/app/com.duckonthewater.ouch-1/base.apk"],nativeLibraryDirectories=[/data/app/com.duckonthewater.ouch-1/lib/x86, /vendor/lib, /system/lib]] 05-31 05:51:10.040: E/Unity(4692): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 05-31 05:51:10.040: E/Unity(4692): at java.lang.ClassLoader.l
So it doesn't find the dependencies, I guess. I copied "play-services-ads-12.0.1.aar" to the Plugins/Android Folder but it doesn't help.
Also tried to work with the other resolve package "play-services-resolver-1.2.72.0.package" and with another admop package "admob_unity_plugin.unitypackage" but nothing is working....
I guess this whole automatic dependecies crap is not working at all for me, whatever I try (but Unity always says "it worked"). So I would like to know which dependencies/plugins I need to put where to solve the problem manually.
I fixed it this way. $$anonymous$$aybe it helps you too.
I found out that the import of the plugin wasn't done without errors (->Console). This was my solution: https://forum.unity.com/threads/unity-admob-error.275279/ (Actually it was another page but i don't find it anymore....the problem was that the JAVA_Home value was not set).
Assets-> Play Services Resolver -> Android Resolver -> Settings -> UNcheck Use Gradle Daemon
Assets-> Play Services Resolver -> Android Resolver -> Force Resolve
Then everything worked :)