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

Android SDK Installation Path Cannot Contain Whitespace #789

Closed
rmartin16 opened this issue Jul 14, 2022 · 0 comments · Fixed by #791
Closed

Android SDK Installation Path Cannot Contain Whitespace #789

rmartin16 opened this issue Jul 14, 2022 · 0 comments · Fixed by #791
Labels
bug A crash or error in behavior.

Comments

@rmartin16
Copy link
Member

rmartin16 commented Jul 14, 2022

Describe the bug
Parts of the Android SDK do not support running from an installation path that contains whitespace, e.g. /sdks/android sdk/.

Briefcase's data directory was moved from ~/.briefcase to OS-native locations in #777; for macOS, this location is ~/Library/Application Support/briefcase and encountered this existing issue for Android SDK.

(venv-3.9) user@users-MacBook-Pro helloworld % briefcase run android -v

The Android tools provided by Google have license terms that you must accept
before you may use those tools.

>>> Running Command:
>>>     '/Users/user/Library/Application Support/briefcase/tools/android_sdk/cmdline-tools/latest/bin/sdkmanager' --licenses
>>> Environment Overrides:
>>>     ANDROID_SDK_ROOT=/Users/user/Library/Application Support/briefcase/tools/android_sdk
>>>     JAVA_HOME=/Users/user/Library/Application Support/briefcase/tools/java/Contents/Home
Error: Could not find or load main class Support.briefcase.tools.android_sdk.cmdline-tools.latest
>>> Return code: 1

In android/ndk#1400, it was noted this is unlikely to ever be fixed. And the internet is full of people encountering this problem.

Of note, though, this is not limited to macOS.
On Linux, if you set XDG_DATA_HOME=/mnt/my data/, for example, you'll have the same problem.
On Windows, the user's home directory will contain a space if the user specifies a space in their "name" during account creation. Therefore, while the specific issue outlined above may not surface, other issues with Android SDK and whitespace could occur on Windows.

To Reproduce
Steps to reproduce the behavior (on macOS):

  1. Install affected briefcase version:
  • pip install git+https://github.com/beeware/briefcase.git@baf2942d08e09f8bb61fcecafb148904bedec6c2
  1. Run briefcase new --no-input && cd helloworld && briefcase run android

Expected behavior
The Android SDK should properly run from briefcase's default installation location regardless of platform or user/system configuration.

@rmartin16 rmartin16 added the bug A crash or error in behavior. label Jul 14, 2022
rmartin16 added a commit to rmartin16/briefcase that referenced this issue Jul 14, 2022
rmartin16 added a commit to rmartin16/briefcase that referenced this issue Jul 14, 2022
rmartin16 added a commit to rmartin16/briefcase that referenced this issue Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant