Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio debugger stops unexpectedly

I'm not being able to debug my app as after setting a breakpoint and debugger stops at it, it then stops suddenly after two or three seconds and app exits with no aparent reason.

I've tried setting the breakpoint at different locations to ensure no other background process is interfering with it, for example at the very beginning of onCreate in splash activity, but the same happens, debugger stops as expected and after a few seconds app exits and debugging session ends unexpectedly.

I've tried updating Android Studio and Gradle to latest version (my AS is 3.6.1) and Gradle 5.6.4 (plugin version is 3.6.1) to no avail. Also tried uninstalling/reinstalling the app to no avail too and lastly I've tried "Invalidate caches and restart" option in Android Studio but it neither worked.

I'm not being able to debug and don't know what else to try / do.

My mobile is a Huawei Mate 20 Lite, and I've also tried rebooting the phone with no success.

Here is my "Logcat" as soon as debugger stops and app exits (app figures as 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

Edit 1:

Inspecting Logcat I can guess that maybe "ZRHungService" is causing the problem, but cannot find any information about this service.

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

Edit 2:

I've tried debugging in a virtual device with success, but the problem is I'm debugging the copy of a file in downloads to cache dir and in virtual device I don't have that file, so I think that's not an option :(

like image 744
Diego Perez Avatar asked Mar 06 '20 18:03

Diego Perez


1 Answers

I am getting the same issue if anyone from Huawei, or users of them have found real solutions yet. It's only just started happening on my Mate 20 Pro since it was updated to Android 10 a few days ago.

Here are my logcat lines for the app. Dies after 3-4 secs of being on a breakpoint :

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

I have found one temporary solution. Set a debug app in your devleoper options on your phone and tell it to wait for debugger. Then launch it and you can attach the debugger from Android Studio and all works well.

  • Settings -> System and Updates -> Developer Options
  • Under Debugging find 'Select debug app' and choose your app
  • Tick ON 'Wait for debugger'
  • Run app from app drawer
  • In Android Studio choose attach debugger instead and breakpoints no longer crash

Dev Options Select debug app.

like image 183
Captain Wizard Avatar answered Sep 25 '22 08:09

Captain Wizard