Hi, I have to integrate AdMob into my Unity Project.
I followed the steps of installing the latest unity package from the official guide, I did install
GoogleMobileAds-v7.1.0.unitypackage then I installed
GoogleMobileAds-Ad-Placements.unitypackage. I ran
Resolve,
Force Resolve, and
Delete Resolved Librariesthen I did the GoogleMobileAdsSettings setup by enabling
Google AdMob Enabled = ✔ , AdMob App ID Android = "Filled with my app admob id"
then i went to my initializing script and added these lines of code
/////////////////////////////////////////////////////
using GoogleMobileAds.Api;
void Start(){
AdModInit();
}
void AdModInit(){
Status = "Initializing Ads Service";
// Initialize the Google Mobile Ads SDK.
MobileAds.Initialize(initStatus => {
Status = "Ads Service is Initalized successfully";
Ads_St = true;
});
}
////////////////////////////////////////////////////////
When I start Unity I get this error
Unloading broken assembly Assets/GoogleMobileAds/GoogleMobileAds.Unity.dll, this assembly can cause crashes in the runtime
When I build my project and run my game, at the initialization scene where the script is, the logcat outputs the following errors
AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.gms.ads.initialization.OnInitializationCompleteListener
07-01 22:16:13.221 9719 9739 E Unity : java.lang.ClassNotFoundException: com.google.android.gms.ads.initialization.OnInitializationCompleteListener
07-01 22:16:13.221 9719 9739 E Unity : at java.lang.Class.classForName(Native Method)
07-01 22:16:13.221 9719 9739 E Unity : at java.lang.Class.forName(Class.java:454)
07-01 22:16:13.221 9719 9739 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
07-01 22:16:13.221 9719 9739 E Unity : at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
07-01 22:16:13.221 9719 9739 E Unity : at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
07-01 22:16:13.221 9719 9739 E Unity : at android.os.Handler.dispatchMessage(Handler.java:102)
07-01 22:16:13.221 9719 9739 E Unity : at android.os.Looper.loopOnce(Looper.java:201)
07-01 22:16:13.221 9719 9739 E Unity : at android.os.Looper.loop(Looper.java:288)
07-01 22:16:13.221 9719 9739 E Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
07-01 22:16:13.221 9719 9739 E Unity : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.initialization.OnInitializationCompleteListener" on path: DexPathList[[zip file "/data/app/~~Bd-NqdABYBlzmZdSPtdakw==/com.Evag.SMX-3Kx-EPExw4mC3jjw_ycqIA==/base.apk"],nativeLibraryDirectories=