From de79cc98a298df74c234a45ee7f1e80de50b140a Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 6 Oct 2022 15:13:39 +0000 Subject: [PATCH] android sdk tools: adapt path to file hierarchy changes Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: https://github.com/kivy/python-for-android/issues/2540 https://github.com/kivy/python-for-android/pull/2593 --- pythonforandroid/build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pythonforandroid/build.py b/pythonforandroid/build.py index 42b6b52add..896e74cd79 100644 --- a/pythonforandroid/build.py +++ b/pythonforandroid/build.py @@ -29,7 +29,9 @@ def get_targets(sdk_dir): if exists(join(sdk_dir, 'cmdline-tools', 'latest', 'bin', 'avdmanager')): avdmanager = sh.Command(join(sdk_dir, 'cmdline-tools', 'latest', 'bin', 'avdmanager')) targets = avdmanager('list', 'target').stdout.decode('utf-8').split('\n') - + elif exists(join(sdk_dir, 'cmdline-tools', 'bin', 'avdmanager')): + avdmanager = sh.Command(join(sdk_dir, 'cmdline-tools', 'bin', 'avdmanager')) + targets = avdmanager('list', 'target').stdout.decode('utf-8').split('\n') elif exists(join(sdk_dir, 'tools', 'bin', 'avdmanager')): avdmanager = sh.Command(join(sdk_dir, 'tools', 'bin', 'avdmanager')) targets = avdmanager('list', 'target').stdout.decode('utf-8').split('\n')