E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.valentines.zipperlock, PID: 1667
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://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:5166)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4758)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4698)
at android.app.ActivityThread.access$1600(ActivityThread.java:163)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1419)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5536)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1397)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1192)
Caused by: java.lang.IllegalStateException:
******************************************************************************
* The Google Mobile Ads SDK was initialized 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.zzyc.attachInfo(com.google.android.gms:play-services-ads-lite@@19.1.0:33)
at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite@@19.1.0:3)
at android.app.ActivityThread.installProvider(ActivityThread.java:5163)
... 11 more
通过添加一个名称为com.google.android.gms.ads.APPLICATION_ID的标签,将您的AdMob App ID添加到您的应用程序的AndroidManifest.xml文件中,如下所示。
你可以在AdMob用户界面中找到你的App ID。对于android:value在引号中插入你自己的AdMob App ID,如下图所示。
<manifest>
<application>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
</application>
更多细节请查看 网页.