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

Error during briefcase run android with Android phone connected #1627

Closed
huats opened this issue Feb 2, 2024 · 6 comments · Fixed by #1629
Closed

Error during briefcase run android with Android phone connected #1627

huats opened this issue Feb 2, 2024 · 6 comments · Fixed by #1629
Labels
android The issue relates to Android mobile support. bug A crash or error in behavior.

Comments

@huats
Copy link

huats commented Feb 2, 2024

Describe the bug

I am following the tutorial

If I don't have anything connected to my laptop I can run "briefcase run android" without issue.

But when I plug my android phone (Pixel 7) with developper options and USB Debugging On) the command fails

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

It should crash :)

Screenshots

image

Environment

  • Operating System: OS X
  • Python version: 3.11
  • Software versions:
    • Briefcase:
    • Toga:
    • ...

Logs


Additional context

No response

@huats huats added the bug A crash or error in behavior. label Feb 2, 2024
@rmartin16
Copy link
Member

Please upload the log file mentioned in yellow in your screenshot.

@rmartin16 rmartin16 added the android The issue relates to Android mobile support. label Feb 2, 2024
@huats
Copy link
Author

huats commented Feb 2, 2024

@rmartin16
Copy link
Member

rmartin16 commented Feb 2, 2024

Thank you; and thanks for letting us know the tutorial didn't work for you.

1-1 seems to be the problem here.

           >>> Running Command:                                                                                                                                    subprocess.py:712
           >>>     /Users/chris/Library/Caches/org.beeware.briefcase/tools/android_sdk/platform-tools/adb devices -l                                               subprocess.py:713
           >>> Working Directory:                                                                                                                                  subprocess.py:720
           >>>     /Users/chris/beeware-tutorial/helloworld                                                                                                        subprocess.py:721
           >>> Command Output:                                                                                                                                     subprocess.py:737
           >>>     List of devices attached                                                                                                                        subprocess.py:739
           >>>     XXXX         device 1-1 product:panther model:Pixel_7 device:panther transport_id:5                                                   subprocess.py:739
           >>>     emulator-5554          device product:sdk_phone64_arm64 model:Android_SDK_built_for_arm64 device:emulator64_arm64 transport_id:1                subprocess.py:739
           >>>                                                                                                                                                     subprocess.py:739
           >>> Return code: 0                                                                                                                                      subprocess.py:748

Giving it a go with my own Pixel 7, I hit a similar issue.....now to log out and back in to add this group.

❯ briefcase run android -vv
Using JDK at /home/russell/.cache/briefcase/tools/java17
Using Android SDK at /home/russell/.cache/briefcase/tools/android_sdk
Android emulator is already installed.

>>> Running Command:
>>>     /home/russell/.cache/briefcase/tools/android_sdk/platform-tools/adb devices -l
>>> Working Directory:
>>>     /home/russell/tmp/beeware/helloworld
>>> Command Output:
>>>     List of devices attached
>>>     XXXX                              no permissions (user russell is not in the plugdev group); see [http://developer.android.com/tools/device.html] usb:5-4.4.1 transport_id:1
>>>     
>>> Return code: 0


Extra information:

>>> Running Command:
>>>     /home/russell/.cache/briefcase/tools/android_sdk/cmdline-tools/9.0/bin/sdkmanager --list_installed
>>> Working Directory:
>>>     /home/russell/tmp/beeware/helloworld
>>> Environment Overrides:
>>>     ANDROID_HOME=/home/russell/.cache/briefcase/tools/android_sdk
>>>     ANDROID_SDK_ROOT=/home/russell/.cache/briefcase/tools/android_sdk
>>>     JAVA_HOME=/home/russell/.cache/briefcase/tools/java17
>>> Command Output:
>>>     Loading package information...                                                  
>>>     Loading local repository...                                                     
>>>     [=========                              ] 25% Loading local repository...       
>>>     [=========                              ] 25% Fetch remote repository...        
>>>     [=======================================] 100% Fetch remote repository...       
>>>     Installed packages:
>>>       Path                                    | Version | Description                    | Location                               
>>>       -------                                 | ------- | -------                        | -------                                
>>>       build-tools;30.0.3                      | 30.0.3  | Android SDK Build-Tools 30.0.3 | build-tools/30.0.3                     
>>>       build-tools;34.0.0                      | 34.0.0  | Android SDK Build-Tools 34     | build-tools/34.0.0                     
>>>       emulator                                | 32.1.15 | Android Emulator               | emulator                               
>>>       platform-tools                          | 34.0.5  | Android SDK Platform-Tools     | platform-tools                         
>>>       platforms;android-33                    | 3       | Android SDK Platform 33        | platforms/android-33                   
>>>       platforms;android-34                    | 2       | Android SDK Platform 34        | platforms/android-34                   
>>>       system-images;android-31;default;x86_64 | 5       | Intel x86_64 Atom System Image | system-images/android-31/default/x86_64
>>>     
>>> Return code: 0

[edit]
They've really made this so complicated...had to add udev rules as well...

❯ /home/russell/.cache/briefcase/tools/android_sdk/platform-tools/adb devices -l
List of devices attached
2A181FDH200FKW         no permissions (missing udev rules? user is in the plugdev group); see [http://developer.android.com/tools/device.html] usb:5-4.4.1 transport_id:

This suggests we should include what adb device -l outputs when this process fails.

It finally did eventually work, though.

❯ briefcase run android -vv
Using JDK at /home/russell/.cache/briefcase/tools/java17
Using Android SDK at /home/russell/.cache/briefcase/tools/android_sdk
Android emulator is already installed.

>>> Running Command:
>>>     /home/russell/.cache/briefcase/tools/android_sdk/platform-tools/adb devices -l
>>> Working Directory:
>>>     /home/russell/tmp/beeware/helloworld
>>> Command Output:
>>>     List of devices attached
>>>     XXXX         device usb:5-4.4.1 product:panther model:Pixel_7 device:panther transport_id:1
>>>     
>>> Return code: 0

>>> Running Command:
>>>     /home/russell/.cache/briefcase/tools/android_sdk/platform-tools/adb -s 2A181FDH200FKW emu avd name
>>> Working Directory:
>>>     /home/russell/tmp/beeware/helloworld
>>> Return code: 1

>>> Running Command:
>>>     /home/russell/.cache/briefcase/tools/android_sdk/emulator/emulator -list-avds
>>> Working Directory:
>>>     /home/russell/tmp/beeware/helloworld
>>> Command Output:
>>>     beePhone
>>> Return code: 0

Select device:

  1) Pixel 7 (XXXX)
  2) @beePhone (emulator)
  3) Create a new Android emulator

> 

@rmartin16
Copy link
Member

rmartin16 commented Feb 2, 2024

Seems like a macOS thing. I was able to pass my Pixel 7 through to my Sonoma VM.

>>> Running Command:
>>>     /Users/user/Library/Caches/org.beeware.briefcase/tools/android_sdk/platform-tools/adb devices -l
>>> Working Directory:
>>>     /Users/user/tmp/beeware/helloworld
>>> Command Output:
>>>     List of devices attached
>>>     XXXX         device 231-1 product:panther model:Pixel_7 device:panther transport_id:1
>>>
>>> Return code: 0

briefcase.2024_02_02-17_24_15.run.log

@freakboy3742
Copy link
Member

@huats Thanks for the report - based on that logging detail, I've put together PR #1629 that should address the issue.

@huats
Copy link
Author

huats commented Feb 3, 2024

Thanks a lot ! Looking to try the fix !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android The issue relates to Android mobile support. bug A crash or error in behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants