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

Add --sdk_root arg to sdkmanager #1056

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions buildozer/targets/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ def p4a_recommended_android_ndk(self):

def _sdkmanager(self, *args, **kwargs):
"""Call the sdkmanager in our Android SDK with the given arguments."""
# Add --sdk_root to account for Android command line tools bug
args += (f"--sdk_root={self.android_sdk_dir}",)
# Use the android-sdk dir as cwd by default
kwargs['cwd'] = kwargs.get('cwd', self.android_sdk_dir)
command = self.sdkmanager_path + ' ' + ' '.join(args)
Expand Down Expand Up @@ -530,8 +532,9 @@ def _android_update_sdk(self, *sdkmanager_commands):
# This leads to a stderr "Broken pipe" message which is harmless,
# but doesn't look good on terminal, hence redirecting to /dev/null
yes_command = 'yes 2>/dev/null'
command = '{} | {} --licenses'.format(
yes_command, self.sdkmanager_path)
command = "{} | {} --licenses --sdk_root={}".format(
yes_command, self.sdkmanager_path, self.android_sdk_dir
)
self.buildozer.cmd(command, cwd=self.android_sdk_dir)
else:
kwargs['show_output'] = True
Expand Down