java.lang.RuntimeException:无法获取提供程序com.google.android.gms.ads.MobileAdsInitProvider:java.lang.IllegalStateException:

时间:2020-06-22 19:38:17

标签: java android

如何在Java Studio中的Android Studio 4.0中解决此问题

我在我的项目中没有使用任何admob,但是它也显示此错误。请帮助我尝试您在上述解决方案中提到的内容。 但是错误仍然存​​在。...

2020-06-23 00:59:20.816 10332-10332/? W/ample.importcs: Unexpected CPU variant for X86 using defaults: x86
2020-06-23 00:59:22.200 10332-10332/com.example.importcsv E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.importcsv, PID: 10332
    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: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 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.zzyz.attachInfo(com.google.android.gms:play-services-ads-lite@@19.2.0:33)
        at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite@@19.2.0:3)
        at android.app.ActivityThread.installProvider(ActivityThread.java:6983)
            ... 10 more```

2 个答案:

答案 0 :(得分:1)

仅将此代码添加到您应用的清单中就可以了

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

答案 1 :(得分:0)

在android studio中,转到项目结构并删除广告依赖项(如果您不在项目中使用它)。