简体   繁体   English

我无法在 android 上运行我的计算器应用程序

[英]I am having trouble with running my calculator app on android

$ adb shell am start -n "me.zanecoleriley.calculator/me.zanecoleriley.calculator.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Connected to process 7940 on device 'emulator-5554'. $ adb shell am start -n "me.zanecoleriley.calculator/me.zanecoleriley.calculator.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Connected to process 7940 on device 'emulator-5554 '。 Capturing and displaying logcat messages from application.从应用程序捕获和显示 logcat 消息。 This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.可以在“调试器”设置页面的“Logcat 输出”部分禁用此行为。 D/NetworkSecurityConfig: No Network Security Config specified, using platform default D/NetworkSecurityConfig: No Network Security Config specified, using platform default D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: me.zanecoleriley.calculator, PID: 7940 java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException: D/NetworkSecurityConfig:未指定网络安全配置,使用平台默认值 D/NetworkSecurityConfig:未指定网络安全配置,使用平台默认值 D/AndroidRuntime:关闭 VM E/AndroidRuntime:致命异常:主进程:me.zanecoleriley.calculator,PID : 7940 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: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

I've tried to fix it to no avail我试图修复它无济于事

Have you tried adding the android:usesCleartextTraffic="true" in the application tag in your AndroidManifest.xml file?您是否尝试在 AndroidManifest.xml 文件的应用程序标签中添加android:usesCleartextTraffic="true" Also try to add <uses-permission android:name="android.permission.INTERNET" /> over your application tag.还尝试在您的应用程序标签上添加<uses-permission android:name="android.permission.INTERNET" />

If that does not help, than you can also try out this: https://developer.android.com/training/articles/security-config.html如果这没有帮助,你也可以试试这个: https://developer.android.com/training/articles/security-config.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM