The Google Mobile Ads SDK was initialized incorrectly Error

Viewed 676

I understand that there are already a lot of similar questions on the forum, but the solutions do not help me. I try to run the game (Made on unity) And it immediately flies out.

11-17 14:26:16.842 24616 24616 E AndroidRuntime: FATAL EXCEPTION: main 11-17 14:26:16.842 24616 24616 E AndroidRuntime: Process: com.mgamezmonster.classicsudoku, PID: 24616 11-17 14:26:16.842 24616 24616 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException: 11-17 14:26:16.842 24616 24616 E AndroidRuntime: 11-17 14:26:16.842 24616 24616 E AndroidRuntime: ****************************************************************************** 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * should follow the instructions here: * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * https://googlemobileadssdk.page.link/admob-android-update-manifest * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * to add a valid App ID inside the AndroidManifest. * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * Google Ad Manager publishers should follow instructions here: * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: ****************************************************************************** 11-17 14:26:16.842 24616 24616 E AndroidRuntime: 11-17 14:26:16.842 24616 24616 E AndroidRuntime: 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6747) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:6289) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6204) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at android.app.ActivityThread.access$1200(ActivityThread.java:237) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1785) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at android.os.Looper.loop(Looper.java:214) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7050) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: Caused by: java.lang.IllegalStateException: 11-17 14:26:16.842 24616 24616 E AndroidRuntime: 11-17 14:26:16.842 24616 24616 E AndroidRuntime: ****************************************************************************** 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * should follow the instructions here: * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * https://googlemobileadssdk.page.link/admob-android-update-manifest * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * to add a valid App ID inside the AndroidManifest. * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * Google Ad Manager publishers should follow instructions here: * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. * 11-17 14:26:16.842 24616 24616 E AndroidRuntime: ****************************************************************************** 11-17 14:26:16.842 24616 24616 E AndroidRuntime: 11-17 14:26:16.842 24616 24616 E AndroidRuntime: 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at com.google.android.gms.internal.ads.zzya.attachInfo(com.google.android.gms:play-services-ads-lite@@19.0.0:27) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite@@19.0.0:3) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6742) 11-17 14:26:16.842 24616 24616 E AndroidRuntime: ... 10 more

I checked the manifest file and it's fine. I tried changing some settings in unity itself but nothing helps me. My manifest:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.unity.ads" android:versionName="1.0" android:versionCode="1"> <application> <uses-library android:required="false" android:name="org.apache.http.legacy" /> <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-8340576279106634~6644533547" /> <meta-data android:name="com.google.android.gms.ads.AD_MANAGER_APP" android:value="true" /> </application> </manifest>

enter image description here enter image description here

1 Answers

Did you check this section of your android manifest and you have correct GAD ? And if you are still having the same issue you should follow the instructions here -> https://developers.google.com/admob/android/quick-start#update_your_androidmanifestxml

Also you want to search your project to see if you have more than 1 AndroidManifest.xml files. It is okay to have more than 1 but maybe another manifest is also containing a different GAD.

enter image description here

Related