Android studio XXX keeps stopping-ThrowExceptions

Exception or error:

All build runs are fine, but the app is not running

And when I rerun it,get this problems in Run.

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.jsw.practice, PID: 13246
java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:

******************************************************************************
* The Google Mobile Ads SDK was initialised incorrectly. AdMob publishers    *
* should follow the instructions here:                                       *
* https://googlemobileadssdk.page.link/admob-android-update-manifest         *
* to add a valid App ID inside the AndroidManifest.                          *
* Google Ad Manager publishers should follow instructions here:              *
* https://googlemobileadssdk.page.link/ad-manager-android-update-manifest.   *
******************************************************************************


    at android.app.ActivityThread.installProvider(ActivityThread.java:6988)
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:6528)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6445)
    at android.app.ActivityThread.access$1300(ActivityThread.java:219)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7356)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
 Caused by: java.lang.IllegalStateException: 

******************************************************************************
* The Google Mobile Ads SDK was initialised incorrectly. AdMob publishers    *
* should follow the instructions here:                                       *
* https://googlemobileadssdk.page.link/admob-android-update-manifest         *
* to add a valid App ID inside the AndroidManifest.                          *
* Google Ad Manager publishers should follow instructions here:              *
* https://googlemobileadssdk.page.link/ad-manager-android-update-manifest.   *
******************************************************************************


    at com.google.android.gms.internal.ads.zzxw.attachInfo(com.google.android.gms:play-services-ads-lite@@18.3.0:27)
    at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite@@18.3.0:3)
    at android.app.ActivityThread.installProvider(ActivityThread.java:6983)

… 10 more

and sometimes This problem occurs in the event log.


Emulator: emulator: WARNING: EmulatorService.cpp:448: Cannot find certfile: C:\Users\cso32.android\emulator-grpc.cer security will be disabled.

Emulator: Started GRPC server at 127.0.0.1:8554

I’m still learning, so I put in adview, scrolling and deleted at the end and made an application, and then I realised that it’s not working on emulator like this way.

what should I do? T.T(Please understand that I am not good at English.)

How to solve:

You should create adMobile account then register your app,

as what it says in following the link
https://developers.google.com/admob/android/quick-start#prerequisites

after that get the app id from registration page and add it to the manifest

<meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="YOUR_APP_ID"/>

Leave a Reply

Your email address will not be published. Required fields are marked *