Skip to content

Commit 098098f

Browse files
SomberNightaccumulator
authored andcommitted
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: kivy#2540 kivy#2593
1 parent d7a8e6d commit 098098f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pythonforandroid/build.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ def get_toolchain_versions(ndk_dir, arch):
7373

7474

7575
def get_targets(sdk_dir):
76-
if exists(join(sdk_dir, 'tools', 'bin', 'avdmanager')):
76+
if exists(join(sdk_dir, 'cmdline-tools', 'bin', 'avdmanager')):
77+
avdmanager = sh.Command(join(sdk_dir, 'cmdline-tools', 'bin', 'avdmanager'))
78+
targets = avdmanager('list', 'target').stdout.decode('utf-8').split('\n')
79+
elif exists(join(sdk_dir, 'tools', 'bin', 'avdmanager')):
7780
avdmanager = sh.Command(join(sdk_dir, 'tools', 'bin', 'avdmanager'))
7881
targets = avdmanager('list', 'target').stdout.decode('utf-8').split('\n')
7982
elif exists(join(sdk_dir, 'tools', 'android')):

0 commit comments

Comments
 (0)