sadiqrazasyed/wallpaperboard-enhanced

Admob error

Alejandro99aru opened this issue · 2 comments

java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:

              ******************************************************************************
              * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
              * should follow the instructions here: https://goo.gl/fQ2neu to add a valid  *
              * App ID inside the AndroidManifest. Google Ad Manager publishers should     *
              * follow instructions here: https://goo.gl/h17b6x.                           *
              ******************************************************************************


                  at android.app.ActivityThread.installProvider(ActivityThread.java:6396)
                  at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)
                  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853)
                  at android.app.ActivityThread.access$1100(ActivityThread.java:199)
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
                  at android.os.Handler.dispatchMessage(Handler.java:106)
                  at android.os.Looper.loop(Looper.java:193)
                  at android.app.ActivityThread.main(ActivityThread.java:6669)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
               Caused by: java.lang.IllegalStateException: 

              ******************************************************************************
              * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
              * should follow the instructions here: https://goo.gl/fQ2neu to add a valid  *
              * App ID inside the AndroidManifest. Google Ad Manager publishers should     *
              * follow instructions here: https://goo.gl/h17b6x.                           *
              ******************************************************************************


                  at com.google.android.gms.internal.ads.zzmn.attachInfo(Unknown Source:17)
                  at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(Unknown Source:3)
                  at android.app.ActivityThread.installProvider(ActivityThread.java:6391)
                  	... 10 more

Please share your AS, Gradle-Tools and Gradle-wrapper.properties version so I can help you out.

Also, head over to build.gralde(library) and change this:

   // Required for OneSignal
    implementation 'com.google.android.gms:play-services-gcm:11.8.0'
    implementation 'com.google.android.gms:play-services-analytics:11.8.0'

    // Google Ads
    compile 'com.google.android.gms:play-services-ads:11.8.0'

To

    // Required for OneSignal
    implementation 'com.google.android.gms:play-services-gcm:12.0.1'
    implementation 'com.google.android.gms:play-services-analytics:12.0.1'

    // Google Ads
    compile 'com.google.android.gms:play-services-ads:12.0.1'

Then,

  1. Clean Project
  2. Rebuild project
  3. Sync project with Gradle file.

FOR implementation 'com.google.firebase:firebase-ads:17.0.0' you need to do some extra work.

In manifest file you need to add the following code:

    <application>
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="@string/your_application_id" />
    </application>