Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'group' #165

Open
erikhuizinga opened this issue Sep 11, 2020 · 2 comments
Open

AttributeError: 'NoneType' object has no attribute 'group' #165

erikhuizinga opened this issue Sep 11, 2020 · 2 comments

Comments

@erikhuizinga
Copy link

When I run pidcat, I sometimes run into the following issue. Reconnecting my Android devices to my computer or killing the ADB server then helps resolve the issue. However, today I couldn't get pidcat to work at all.

  1. With 2 Android emulators running
  2. And an app running
  3. In bash:
$ pidcat --current -s emulator-5554
Traceback (most recent call last):
  File "/usr/local/bin/pidcat", line 66, in <module>
    running_package_name = re.search(".*TaskRecord.*A[= ]([^ ^}]*)", system_dump).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

$ pidcat --version
pidcat 2.1.0

Pidcat was installed through Homebrew. My ADB version:

$ adb version
Android Debug Bridge version 1.0.41
Version 30.0.0-6374843
Installed as /usr/local/bin/adb

ADB was installed through Homebrew as well (cask android-platform-tools).


This is just a thought: maybe adb was recently updated to version 30 and this is related to the issue.

ramanr1 added a commit to ramanr1/pidcat that referenced this issue May 15, 2021
Changes in Android Q stopped publishing TaskRecord. 
This changes checks the sdk version of the target devices and uses the correct regex to fetch the package name of the current running app. 

Output of adb -s shell dumpsys activity activities
Api 27: 
```
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Display #0 (activities from top to bottom):
....
    * TaskRecord{389a1bc JakeWharton#66 I=com.google.android.apps.nexuslauncher/.NexusLauncherActivity U=0 StackId=0 sz=1
    ....
      * Hist #0: ActivityRecord{67f6bb3 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t66}
....
```
Api 30
```
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Display #0 (activities from top to bottom):
  Stack #1: type=home mode=fullscreen
  ....
    * Task{3b537df #4644 visible=false type=home mode=fullscreen translucent=true I=com.google.android.apps.nexuslauncher/.NexusLauncherActivity U=0 StackId=1 sz=1}
   ....
      * Hist #0: ActivityRecord{66c039 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t4644}
```

Tested on API 27, 28, 29, 30
@AmauryLiet
Copy link

experiencing the same issue, when working with --current param

for context, I just uninstalled + reinstalled SDK versions from Android Studio

no clue on the fix however, working around it by specifying package name instead of using --current :/

@AmauryLiet
Copy link

AmauryLiet commented Dec 20, 2021

@JakeWharton it seems that @ramanr1 fixed the issue in #174

The issue seems to affect all devices starting from android 10, would be great it you could review/merge the PR ;)

Thanks for the awesome tool!

1fexd pushed a commit to 1fexd/pidcat that referenced this issue Apr 7, 2024
Changes in Android Q stopped publishing TaskRecord. 
This changes checks the sdk version of the target devices and uses the correct regex to fetch the package name of the current running app. 

Output of adb -s shell dumpsys activity activities
Api 27: 
```
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Display #0 (activities from top to bottom):
....
    * TaskRecord{389a1bc JakeWharton#66 I=com.google.android.apps.nexuslauncher/.NexusLauncherActivity U=0 StackId=0 sz=1
    ....
      * Hist #0: ActivityRecord{67f6bb3 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t66}
....
```
Api 30
```
ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Display #0 (activities from top to bottom):
  Stack JakeWharton#1: type=home mode=fullscreen
  ....
    * Task{3b537df #4644 visible=false type=home mode=fullscreen translucent=true I=com.google.android.apps.nexuslauncher/.NexusLauncherActivity U=0 StackId=1 sz=1}
   ....
      * Hist #0: ActivityRecord{66c039 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t4644}
```

Tested on API 27, 28, 29, 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants