首页 > 解决方案 > 在模拟器中调试 Android Intellij AppTutorial 不起作用

问题描述

我已经开始使用 IntelliJ IEDA 来开发 Android 应用程序。但是,我坚持完成教程。虽然我已经解决了不同的问题,但应用程序并未在模拟器中启动。

事件日志显示

15:15   Executing tasks: [:app:assembleDebug] in project C:\Users\andregro\IntelliJIDEAProjects\HelloDroid2

15:15   Gradle build finished in 657 ms

15:15   Launch succeeded

在 Logcat 中

2021-11-06 15:15:08.641 486-1443/? I/ActivityManager: Force stopping com.example.hellodroid appid=10154 user=0: from pid 9390
2021-11-06 15:15:06.549 1843-1843/? W/adbd: timeout expired while flushing socket, closing
2021-11-06 15:15:08.647 9390-9392/? I/cmd: oneway function results will be dropped but finished with status OK and parcel size 4
2021-11-06 15:15:08.651 995-995/? D/CarrierSvcBindHelper: No carrier app for: 0
2021-11-06 15:15:08.664 9393-9393/? W/run-as: type=1400 audit(0.0:327): avc: granted { execute } for name="install_server-6b92023b" dev="dm-5" ino=131453 scontext=u:r:runas_app:s0:c154,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c154,c256,c512,c768 tclass=file app=com.example.hellodroid
2021-11-06 15:15:08.681 9396-9398/? I/cmd: oneway function results will be dropped but finished with status OK and parcel size 4
2021-11-06 15:15:08.668 9393-9393/? W/install_server-: type=1400 audit(0.0:328): avc: granted { execute } for path="/data/data/com.example.hellodroid/code_cache/install_server-6b92023b" dev="dm-5" ino=131453 scontext=u:r:runas_app:s0:c154,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c154,c256,c512,c768 tclass=file app=com.example.hellodroid
2021-11-06 15:15:08.713 486-1443/? I/ActivityManager: Force stopping com.example.hellodroid appid=10154 user=0: from pid 9401
2021-11-06 15:15:08.719 995-995/? D/CarrierSvcBindHelper: No carrier app for: 0
2021-11-06 15:15:08.748 486-518/? D/EventSequenceValidator: inc AccIntentStartedEvents to 12
2021-11-06 15:15:08.748 389-600/? W/iorapd: Overwriting transition from kIntentStarted to kIntentStarted into kIntentFailed
2021-11-06 15:15:08.749 486-518/? I/ActivityManager: Force stopping com.example.hellodroid appid=10154 user=-1: set debug app
2021-11-06 15:15:08.755 486-1443/? I/ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.hellodroid/.HelloDroidActivity} from uid 2000
2021-11-06 15:15:08.755 486-1443/? W/ActivityTaskManager: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.hellodroid/.HelloDroidActivity } from null (pid=9407, uid=2000) not exported from uid 10154
2021-11-06 15:15:11.803 458-458/? E/netmgr: qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:network' service: Invalid argument
2021-11-06 15:15:11.803 458-458/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2021-11-06 15:15:11.995 462-462/? E/wifi_forwarder: qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:wififorward' service: Invalid argument
2021-11-06 15:15:11.996 462-462/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2021-11-06 15:15:32.527 7995-8904/? I/NetworkScheduler.Stats: Task com.google.android.gms/com.google.android.gms.tapandpay.gcmtask.TapAndPayGcmTaskService started execution. cause:4 exec_start_elapsed_seconds: 1478 [CONTEXT service_id=218 ]
2021-11-06 15:15:32.535 486-2164/? D/WifiNl80211Manager: Scan result ready event
2021-11-06 15:15:32.535 486-2164/? D/WifiNative: Scan result ready event
2021-11-06 15:15:32.539 7995-8904/? V/NFC: this device does not have NFC support
2021-11-06 15:15:32.540 7995-8904/? W/TapAndPay: NfcAdapter is null while obtaining CardEmulation instance. [CONTEXT service_id=79 ]
    java.lang.NullPointerException: NfcAdapter is null
        at android.nfc.cardemulation.CardEmulation.getInstance(CardEmulation.java:150)
        at anol.<init>(:com.google.android.gms@213918049@21.39.18 (150700-407637301):0)
        at com.google.android.gms.tapandpay.hce.task.TapAndPayAidRegistrationTaskOperation.a(:com.google.android.gms@213918049@21.39.18 (150700-407637301):5)
        at com.google.android.gms.tapandpay.gcmtask.TapAndPayGcmTaskChimeraService.a(:com.google.android.gms@213918049@21.39.18 (150700-407637301):4)
        at aaee.call(:com.google.android.gms@213918049@21.39.18 (150700-407637301):4)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at pvj.c(:com.google.android.gms@213918049@21.39.18 (150700-407637301):6)
        at pvj.run(:com.google.android.gms@213918049@21.39.18 (150700-407637301):7)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at pzp.run(:com.google.android.gms@213918049@21.39.18 (150700-407637301):0)
        at java.lang.Thread.run(Thread.java:923)
2021-11-06 15:15:32.560 7995-8255/? I/NetworkScheduler.Stats: Task com.google.android.gms/com.google.android.gms.checkin.CheckinService started execution. cause:4 exec_start_elapsed_seconds: 1478 [CONTEXT service_id=218 ]
2021-11-06 15:15:32.568 7995-8904/? I/NetworkScheduler.Stats: Task com.google.android.gms/com.google.android.gms.tapandpay.gcmtask.TapAndPayGcmTaskService finished executing. cause:4 result: 3 elapsed_millis: 50 uptime_millis: 50 exec_start_elapsed_seconds: 1478 [CONTEXT service_id=218 ]
2021-11-06 15:15:32.582 7995-8904/? I/NetworkScheduler.Stats: Task com.google.android.gms/com.google.android.gms.checkin.CheckinService finished executing. cause:4 result: 3 elapsed_millis: 20 uptime_millis: 20 exec_start_elapsed_seconds: 1478 [CONTEXT service_id=218 ]
2021-11-06 15:15:32.622 7995-8255/? I/NetworkScheduler.Stats: Task com.google.android.gms/com.google.android.gms.auth.account.be.legacy.AuthCronService started execution. cause:5 exec_start_elapsed_seconds: 1478 [CONTEXT service_id=218 ]
2021-11-06 15:15:32.719 193-196/? E/android.system.suspend@1.0-service: Error opening kernel wakelock stats for: wakeup34: Permission denied
2021-11-06 15:15:32.716 193-193/? W/Binder:193_2: type=1400 audit(0.0:329): avc: denied { read } for name="wakeup34" dev="sysfs" ino=18607 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
2021-11-06 15:15:32.722 193-196/? E/android.system.suspend@1.0-service: Error opening kernel wakelock stats for: wakeup35: Permission denied
2021-11-06 15:15:32.720 193-193/? W/Binder:193_2: type=1400 audit(0.0:330): avc: denied { read } for name="wakeup35" dev="sysfs" ino=18670 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
2021-11-06 15:15:32.760 7995-8090/? W/GLSUser: [AppCertManager] IOException while requesting key: 
    java.io.IOException: Invalid device key response.
        at hxx.b(:com.google.android.gms@213918049@21.39.18 (150700-407637301):28)
        at hxv.f(:com.google.android.gms@213918049@21.39.18 (150700-407637301):2)
        at hxr.a(:com.google.android.gms@213918049@21.39.18 (150700-407637301):0)
        at fjl.d(:com.google.android.gms@213918049@21.39.18 (150700-407637301):6)
        at gkv.call(:com.google.android.gms@213918049@21.39.18 (150700-407637301):13)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at pvj.c(:com.google.android.gms@213918049@21.39.18 (150700-407637301):6)
        at pvj.run(:com.google.android.gms@213918049@21.39.18 (150700-407637301):7)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at pzp.run(:com.google.android.gms@213918049@21.39.18 (150700-407637301):0)
        at java.lang.Thread.run(Thread.java:923)
2021-11-06 15:15:32.766 7995-8904/? I/NetworkScheduler.Stats: Task com.google.android.gms/com.google.android.gms.auth.account.be.legacy.AuthCronService finished executing. cause:5 result: 3 elapsed_millis: 156 uptime_millis: 156 exec_start_elapsed_seconds: 1478 [CONTEXT service_id=218 ]
2021-11-06 15:15:33.328 7688-7737/? I/Finsky:download_service: [597] nmi.run(36): Stats for Executor: bgExecutor non@dbe4e68[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
2021-11-06 15:15:47.872 193-196/? E/android.system.suspend@1.0-service: Error opening kernel wakelock stats for: wakeup34: Permission denied
2021-11-06 15:15:47.868 193-193/? W/Binder:193_2: type=1400 audit(0.0:331): avc: denied { read } for name="wakeup34" dev="sysfs" ino=18607 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
2021-11-06 15:15:47.875 193-196/? E/android.system.suspend@1.0-service: Error opening kernel wakelock stats for: wakeup35: Permission denied
2021-11-06 15:15:47.872 193-193/? W/Binder:193_2: type=1400 audit(0.0:332): avc: denied { read } for name="wakeup35" dev="sysfs" ino=18670 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
2021-11-06 15:16:07.380 486-1443/? I/ActivityManager: Force stopping com.example.hellodroid appid=10154 user=0: from pid 9431
2021-11-06 15:16:07.383 9431-9433/? I/cmd: oneway function results will be dropped but finished with status OK and parcel size 4
2021-11-06 15:16:07.387 995-995/? D/CarrierSvcBindHelper: No carrier app for: 0

最后调试选项卡显示:

11/06 15:15:09: Launching 'app' on Pixel 4 API 30.
Install successfully finished in 68 ms.
$ adb shell am start -n "com.example.hellodroid/com.example.hellodroid.HelloDroidActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Waiting for application to come online: com.example.hellodroid | com.example.hellodroid.test
Could not connect to remote process. Aborting debug session.

我已经尝试重新安装所有内容,但问题仍然存在。

最好的问候, AG

标签: javaandroidintellij-ideajetbrains-ide

解决方案


推荐阅读