【问题标题】:I am having trouble with running my calculator app on android我无法在 Android 上运行我的计算器应用程序
【发布时间】:2021-03-20 21:07:00
【问题描述】:

$ adb shell am start -n "me.zanecoleriley.calculator/me.zanecoleriley.calculator.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER 连接到设备“emulator-5554”上的进程 7940。 从应用程序捕获和显示 logcat 消息。可以在“调试器”设置页面的“Logcat 输出”部分禁用此行为。 D/NetworkSecurityConfig:未指定网络安全配置,使用平台默认值 D/NetworkSecurityConfig:未指定网络安全配置,使用平台默认值 D/AndroidRuntime:关闭虚拟机 E/AndroidRuntime: 致命异常: main 进程:me.zanecoleriley.calculator,PID:7940 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:7244)
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:6780)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6697)
    at android.app.ActivityThread.access$1300(ActivityThread.java:237)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7656)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
 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:7239)
        ... 10 more

我已经尝试过修复,但无济于事

【问题讨论】:

  • 你说你“试图修复它无济于事”但你实际上做了什么?你知道我们不能从这里看到你,不是吗?您是否点击了链接并阅读并按照说明进行操作?

标签: java android gradle


【解决方案1】:

您是否尝试在 AndroidManifest.xml 文件的应用程序标记中添加 android:usesCleartextTraffic="true"?还可以尝试在您的应用程序标签上添加<uses-permission android:name="android.permission.INTERNET" />

如果这没有帮助,您也可以试试这个:https://developer.android.com/training/articles/security-config.html

【讨论】:

    猜你喜欢
    • 2017-07-03
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多