簡體   English   中英

Android Studio 調試器意外停止

[英]Android Studio debugger stops unexpectedly

我無法調試我的應用程序,因為在設置斷點和調試器停止之后,它會在兩三秒后突然停止並且應用程序無緣無故退出。

我已經嘗試在不同的位置設置斷點以確保沒有其他后台進程干擾它,例如在啟動活動的 onCreate 開始時,但同樣發生,調試器按預期停止,幾秒鍾后應用程序退出並調試會話意外結束。

我已經嘗試將 Android Studio 和 Gradle 更新到最新版本(我的 AS 是 3.6.1)和 Gradle 5.6.4(插件版本是 3.6.1),但無濟於事。 還嘗試卸載/重新安裝應用程序也無濟於事,最后我在 Android Studio 中嘗試了“使緩存無效並重新啟動”選項,但它都不起作用。

我無法調試,也不知道還能嘗試/做什么。

我的手機是華為 Mate 20 Lite,我也試過重啟手機,但沒有成功。

這是調試器停止和應用程序退出后的“Logcat”(應用程序數字為 com.mycompany.myapp):

2020-03-06 19:20:39.719 1408-1432/? E/WindowManager: icon is null!!
2020-03-06 19:20:39.722 1408-1432/? E/WindowManager: icon is null!!
2020-03-06 19:20:39.724 1408-1432/? E/WindowManager: icon is null!!
2020-03-06 19:20:39.777 2462-5966/? E/HwNaturalBase: [Binder:2462_10]: clearDataByOwner ignore: Found null values with the given ownerPkgName is[com.mycompany.myapp].
2020-03-06 19:20:39.778 2334-4531/? E/AwareLog: GameSdkConfigReader: GameSdkLog: idNameMap: null
2020-03-06 19:20:39.809 847-861/? E/AwareLog: iawared: GetFileContent open /proc/14267/task/14277/cpuset fail errno(2)!
2020-03-06 19:20:39.815 14269-14269/? E/ssioncontrolle: Not starting debugger since process cannot load the jdwp agent.
2020-03-06 19:20:39.817 838-838/? E/Thermal-daemon: [shell_frame] temp_new :29  temp_old :28
2020-03-06 19:20:39.817 1408-1927/? E/ProcessInfoCollector: getProcessInfo: failed to find this proc 
2020-03-06 19:20:39.818 838-838/? E/Thermal-daemon: Report temperature: [shell_frame] temp :29  report_threshold:1
2020-03-06 19:20:39.820 838-838/? E/Thermal-daemon: [ap] temp_new :36  temp_old :35
2020-03-06 19:20:39.821 838-838/? E/Thermal-daemon: Report temperature: [ap] temp :36  report_threshold:1
2020-03-06 19:20:39.855 3259-3259/? E/NfcNci: NfcUtils error: APP do not have nfc permission
2020-03-06 19:20:39.857 3259-3259/? E/NfcNci: NfcUtils error: APP do not have nfc permission
2020-03-06 19:20:39.865 2033-2033/? E/HwLauncher: PowerSaveLauncherModel onPackageChanged: not inPowerSaveLauncher 
2020-03-06 19:20:39.865 2033-2033/? E/HwLauncher: StreetModeLauncherModel onPackageChanged: not inStreetModeLauncher 
2020-03-06 19:20:39.889 653-1175/? E/BufferQueueProducer: [com.huawei.android.launcher/com.huawei.android.launcher.unihome.UniHomeLauncher#1]:1338: disconnect: not connected (req=1)
2020-03-06 19:20:39.890 653-2692/? E/BufferQueueProducer: [com.huawei.android.launcher/com.huawei.android.launcher.unihome.UniHomeLauncher#0]:1338: disconnect: not connected (req=1)
2020-03-06 19:20:39.908 642-642/? E/WifiHAL: enter wifi_get_link_stats
2020-03-06 19:20:39.912 1408-1610/? E/WificondControl: Noise: 0, Snr: 0, Chload: -1
2020-03-06 19:20:39.942 577-14300/? E/ResolverController: No valid NAT64 prefix (123, <unspecified>/0)
2020-03-06 19:20:42.444 1408-8027/? E/WifiService: enforceCanAccessScanResults: hiding ssid and bssidLocation mode is disabled for the device
2020-03-06 19:20:42.456 1408-1602/? E/WifiService: enforceCanAccessScanResults: hiding ssid and bssidLocation mode is disabled for the device
2020-03-06 19:20:42.468 2033-2033/? E/HwLauncher: HwAppMarketDownloadModel handleInstallAction op: 2
2020-03-06 19:20:42.663 7452-7525/? E/HSM_UI: SecurityBroadcastReceiver:SecurityBroadcastReceiver the rainbow is not enabled!
2020-03-06 19:20:42.789 577-14311/? E/ResolverController: No valid NAT64 prefix (123, <unspecified>/0)
2020-03-06 19:20:42.956 642-642/? E/WifiHAL: enter wifi_get_link_stats
2020-03-06 19:20:42.963 1408-1610/? E/WificondControl: Noise: 0, Snr: 0, Chload: -1
2020-03-06 19:20:43.173 653-2692/? E/BufferQueueProducer: [Waiting For Debugger: com.mycompany.myapp#0]:1338: disconnect: not connected (req=1)
2020-03-06 19:20:43.185 1408-7773/? E/InputDispatcher: Window handle Window{d9a7484 u0 Waiting For Debugger: com.mycompany.myapp} has no registered input channel
2020-03-06 19:20:43.201 1408-2090/? E/InputDispatcher: Window handle Window{d9a7484 u0 Waiting For Debugger: com.mycompany.myapp} has no registered input channel
2020-03-06 19:20:43.611 14186-14323/com.mycompany.myapp E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@563b55d
2020-03-06 19:20:43.616 14186-14323/com.mycompany.myapp E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@fa4bed2
2020-03-06 19:20:43.650 577-14328/? E/ResolverController: No valid NAT64 prefix (123, <unspecified>/0)
2020-03-06 19:20:44.824 838-838/? E/Thermal-daemon: [ap] temp_new :37  temp_old :36
2020-03-06 19:20:44.828 838-838/? E/Thermal-daemon: Report temperature: [ap] temp :37  report_threshold:1
2020-03-06 19:20:45.312 1408-1610/? E/WificondControl: Noise: 0, Snr: 0, Chload: -1
2020-03-06 19:20:45.842 8205-10507/? E/HSC_SEC: VirusPkgParser:parse InputStream is null
2020-03-06 19:20:45.985 642-642/? E/WifiHAL: enter wifi_get_link_stats
2020-03-06 19:20:45.987 1408-1610/? E/WificondControl: Noise: 0, Snr: 0, Chload: -1
2020-03-06 19:20:46.733 879-996/? E/ScreemCommon: <LOGMGR> <logCaptureFilter> [not the beta version or delimitation frozen, no need to capture log]
2020-03-06 19:20:46.733 879-996/? E/ScreemCommon: ### JankSchedHwRead error!
2020-03-06 19:20:46.734 879-996/? E/ScreemCommon: ### ScreemSchedDlmRead read failed!
2020-03-06 19:20:46.735 879-996/? E/ScreemCommon: ### ScreemSchedDlmRead error!
2020-03-06 19:20:46.737 879-996/? E/ScreemCommon: update dlm info failed
2020-03-06 19:20:46.996 2258-2450/? E/HwCHRWifiRSSIGroupSummery: updatArpSummery mRSSI:-1  HwCHRWifiRSSIGroup [rssi_index=4, rtt_tcp_packets=0, rtt_tcp_duration=0, rtt_lan_duration=5066, rtt_lan_failures=0, rtt_lan_succ=396, rtt_lan_max=324, rtt_lan_min=4,same_area_frequency=0,adjacent_area_frequency=0]
2020-03-06 19:20:47.212 2258-2258/? E/CHR_ChrModemStatistics: sensors invalid
2020-03-06 19:20:47.471 2334-17416/? E/AppInfoMgr: not find pkgs by uid: 0
2020-03-06 19:20:49.008 642-642/? E/WifiHAL: enter wifi_get_link_stats
2020-03-06 19:20:49.013 1408-1610/? E/WificondControl: Noise: 0, Snr: 0, Chload: -1
2020-03-06 19:20:49.393 1408-1431/? E/ActivityTaskManager: app boot failure event send
2020-03-06 19:20:49.443 879-3232/? E/LOGSERVER_UTILS: [ZeroHung]sentEvent: result->scope length:3, wpName length:2
2020-03-06 19:20:49.443 879-3232/? E/LOGSERVER_UTILS: [ZeroHung]sentEvent: recoverSolution length:10, recoverResult length:7, keyLog length:31
2020-03-06 19:20:49.479 879-3232/? E/iMonitor: [ZeroHung]appendFile: open /data/log/reliability/appeye/history.log.0 failed
2020-03-06 19:20:49.484 879-998/? E/ScreemHealth: Get an unregisted msg 3.
2020-03-06 19:20:49.512 1408-1587/? E/WindowManager: win=Window{c946538 u0 com.huawei.android.launcher/com.huawei.android.launcher.unihome.UniHomeLauncher} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=false win.mRemoveOnExit=false
2020-03-06 19:20:49.512 1408-1587/? E/WindowManager: win=Window{b8371be u0 com.huawei.android.launcher/com.huawei.android.launcher.unihome.UniHomeLauncher} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=false win.mRemoveOnExit=false
2020-03-06 19:20:49.533 2334-4108/? E/AwareLog: SPKSchedFeature: Uid has been sent, ignore.
2020-03-06 19:20:49.602 1408-1587/? E/ZRHungService: BF and NFW forceStop package: com.mycompany.myapp
2020-03-06 19:20:49.630 3259-3259/? E/NfcNci: NfcUtils error: APP do not have nfc permission
2020-03-06 19:20:49.637 1899-4895/? E/HsmCoreServiceImpl: onTransact in code is: 102
2020-03-06 19:20:49.637 2334-4531/? E/AwareLog: GameSdkConfigReader: GameSdkLog: idNameMap: null
2020-03-06 19:20:49.638 3259-3259/? E/NfcNci: NfcUtils error: APP do not have nfc permission
2020-03-06 19:20:49.652 21186-21228/? E/AppLifeChangeSensor: CAWARENESS: activityResumed mAppLifeChangeCallback is null 
2020-03-06 19:20:49.653 1899-11648/? E/DollieAdapterService: notifyActivityState pkg:com.huawei.android.launcher/com.huawei.android.launcher.unihome.UniHomeLauncher state:2 fg:true mUid:10074
2020-03-06 19:20:49.657 1408-1432/? E/WindowManager: icon is null!!
2020-03-06 19:20:49.832 838-838/? E/Thermal-daemon: [ap] temp_new :36  temp_old :37
2020-03-06 19:20:49.833 838-838/? E/Thermal-daemon: Report temperature: [ap] temp :36  report_threshold:1
2020-03-06 19:20:50.168 21235-14119/? E/TotemWeather: DeviceStateServiceListener:lastLocation is null

編輯1:

檢查 Logcat 我可以猜測可能是“ZRHungService”導致了問題,但找不到有關此服務的任何信息。

E/ZRHungService: BF and NFW forceStop package: com.mycompany.myapp

編輯2:

我試過在虛擬設備中調試成功,但問題是我正在調試下載中的文件副本到緩存目錄,而在虛擬設備中我沒有那個文件,所以我認為這不是一個選項: (

如果來自華為的任何人或他們的用戶找到了真正的解決方案,我就會遇到同樣的問題。 自從幾天前更新到 Android 10 以來,它才剛剛開始發生在我的 Mate 20 Pro 上。

這是我的應用程序 logcat 行。 在斷點上 3-4 秒后死亡:

2020-03-10 20:22:24.228 711-981/? E/BufferQueueProducer: [Waiting For Debugger: digital.key.testapp#0]:1338: disconnect: not connected (req=1)
2020-03-10 20:22:24.249 1108-2438/? E/InputDispatcher: Window handle Window{b4506fa u0 Waiting For Debugger: digital.key.testapp} has no registered input channel
2020-03-10 20:22:24.422 8057-8106/digital.key.testapp E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@77e0f7
2020-03-10 20:22:30.622 1108-1817/? E/ZRHungService: BF and NFW forceStop package: digital.key.testapp

我找到了一種臨時解決方案。 在手機的 devleoper 選項中設置一個調試應用程序,並告訴它等待調試器。 然后啟動它,您可以從 Android Studio 附加調試器,一切正常。

  • 設置 -> 系統和更新 -> 開發者選項
  • 在調試下找到'Sect debug app'並選擇tour app
  • 勾選“等待 dbugger”
  • 從應用程序抽屜運行應用程序
  • 在 Android Studio 中選擇附加調試器,斷點不再崩潰

開發選項 選擇調試應用 .

華為Mate 20 Lite解決方案
我不知道這如何以及為什么起作用,這不是一種科學方法。 對於那些不使用巫師船長解決方案的人,我發現了一個解決這個問題的奇怪方法。 應考慮上述一些要求。

  1. 正常運行應用
  2. 盡可能快地轉到運行 -> 附加到進程。您必須從運行菜單中選擇此選項,而不是“將調試器附加到 Android 進程”,因為它不起作用。
  3. 出現一個彈出窗口,選擇出現的選項。
  4. 終於有東西出現了,別在意。
  5. 選擇“將調試器附加到 Android 進程”圖標。
  6. 現在,調試過程不應在幾秒鍾后停止。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM