【问题标题】:how I resolve this problem ( unfortunately App has stopped)我如何解决这个问题(不幸的是应用程序已停止)
【发布时间】:2020-10-25 20:16:58
【问题描述】:

厌倦了这个问题 当我运行程序时,出现此消息

07-05 22:10:45.275 6267-6267/? I/art: Late-enabling -Xcheck:jni

07-05 22:10:45.471 6267-6267/? W/System:ClassLoader 引用了未知路径:/data/app/com.example.sendibad-2/lib/arm 07-05 22:10:45.475 6267-6267/? D/ActivityThread: installProvider: context.getPackageName()=com.example.sendibad 07-05 22:10:45.547 6267-6267/? D/AndroidRuntime:关闭虚拟机 07-05 22:10:45.556 6267-6267/? E/AndroidRuntime: 致命异常: main 进程:com.example.sendibad,PID:6267 java.lang.RuntimeException:无法获取提供程序 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:5465)
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:5035)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4975)
    at android.app.ActivityThread.-wrap1(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1549)
    at android.os.Handler.dispatchMessage(Handler.java:111)
    at android.os.Looper.loop(Looper.java:207)
    at android.app.ActivityThread.main(ActivityThread.java:5763)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
 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.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:5462)
        ... 10 more

07-05 22:10:45.602 6267-6267/? I/Process:发送信号。 PID:6267 SIG:9

还有这个 ManiFest

<?xml version="1.0" encoding="utf-8"?>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".Webhtm"></activity>
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

【问题讨论】:

标签: java android


【解决方案1】:

你的实际错误是 -

致命异常:主进程:com.example.sendibad,PID:6267 java.lang.RuntimeException:无法获取提供者 com.google.android.gms.ads.MobileAdsInitProvider

你可以尝试在下面添加代码,看看它是否能解决这里提到的这个问题 - https://stackoverflow.com/a/62080313/1994089

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

【讨论】:

    【解决方案2】:
    1. 转到https://support.google.com/admob/answer/7356219?visit_id=637295692411748559-1196965477&hl=en&ref_topic=7384587&rd=1
    2. 创建一个 Google AdMob 帐户并注册您的应用
    3. 生成 Google AD 密钥
    4. 使用下面链接中列出的步骤,将生成的广告密钥添加到您的清单中

    https://developers.google.com/admob/android/quick-start#update_your_androidmanifestxml

    【讨论】:

    • 谢谢亲爱的,我无法创建 google admob 帐户,因为我住在苏丹,你能告诉我如何取消广告
    • 你可以在这里发布你的 gradle 文件吗?如果您不使用广告,那么您只需从 manifest/gradle 中删除库和相关代码即可。
    • 从你的 android 清单中删除它应该可以解决问题 跨度>
    • 这个 在 Manifest 中找不到我已经在使用 android 4.0。 0
    猜你喜欢
    • 1970-01-01
    • 2022-01-15
    • 2019-04-23
    相关资源
    最近更新 更多