Admob plugin error: Java.Lang.ClassNotFoundException: com.google.android.gms.ads.mobileads

Since switching my build method from internal to gradle I can no longer get the admob plugin to work for unity, the following error is received in logcat:


> 02-05 22:45:56.281: E/Unity(23488):
> AndroidJavaException:
> java.lang.ClassNotFoundException:
> com.google.android.gms.ads.MobileAds
> 02-05 22:45:56.281: E/Unity(23488):
> java.lang.ClassNotFoundException:
> com.google.android.gms.ads.MobileAds
> 02-05 22:45:56.281: E/Unity(23488):
> 	at
> java.lang.Class.classForName(Native
> Method) 02-05 22:45:56.281:
> E/Unity(23488): 	at
> java.lang.Class.forName(Class.java:453)
> 02-05 22:45:56.281: E/Unity(23488):
> 	at
> java.lang.Class.forName(Class.java:378)
> 02-05 22:45:56.281: E/Unity(23488):
> 	at
> com.unity3d.player.UnityPlayer.nativeRender(Native
> Method) 02-05 22:45:56.281:
> E/Unity(23488): 	at
> com.unity3d.player.UnityPlayer.c(Unknown
> Source:0) 02-05 22:45:56.281:
> E/Unity(23488): 	at
> com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown
> Source:151) 02-05 22:45:56.281:
> E/Unity(23488): 	at
> android.os.Handler.dispatchMessage(Handler.java:101)
> 02-05 22:45:56.281: E/Unity(23488):
> 	at
> android.os.Looper.loop(Looper.java:164)
> 02-05 22:45:56.281: E/Unity(23488):
> 	at
> com.unity3d.player.UnityPlayer$c.run(Unknown
> Source:20) 02-05 22:45:56.281:
> E/Unity(23488): Caused by:
> java.lang.ClassNotFoundException:
> Didn't find class
> "com.google.android.gms.ads.MobileAds"
> on path: DexPathList[[zip file
> "/data/app/com.jrfapplications.eggscapade-iB1I9-hArZyWPiiLr_s9zA==/base.apk"],nativeLibraryDirectories=[/data/app/com.jrfapplications.eggscapade-iB1I9-hArZyWPiiLr_s9zA==/lib/arm,
> /data/app/com.jrfapplications.eggscapade-iB1I9-hArZyWPiiLr_

Unity Version: 2017.3.0f3

Android SDK Tools Version: 25.2.5

Admob Plugin: Release Google Mobile Ads Unity Plugin v3.11.0 · googleads/googleads-mobile-unity · GitHub

I have done a force resolve to no avail as well.
Any help would be appreciated.

Thanks

I resolved this by changing the player settings ‘Minify’ under publish settings from proguard to none.

If you haven’t used the Minify option in your build, then it looks like you’re not including the required Google Play dependencies in your Unity project. Ensure the required AAR and JAR files are located in the Assets/Plugins/Android directory. You can perform dependency resolution by selecting Assets → Play Services Resolver → Android Resolver ->Resolve in the Unity editor.