Skip to content

Commit 1803aae

Browse files
committed
fix sdk detection
1 parent 0328b4b commit 1803aae

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

vscode_tasks.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,16 @@ function buildProject() {
8888
}
8989

9090
if [[ ! -f "local.properties" ]]; then
91-
if [[ -n "$ANDROID_SDK_HOME" ]]; then
92-
echo "sdk.dir=$ANDROID_SDK_HOME" >>local.properties
91+
if [[ -n "$ANDROID_HOME" ]]; then
92+
echo "sdk.dir=$ANDROID_HOME" >>local.properties
9393
elif [[ -n "$ANDROID_SDK_ROOT" ]]; then
9494
echo "sdk.dir=$ANDROID_SDK_ROOT" >>local.properties
95+
elif [[ -n "$ANDROID_SDK_HOME" ]]; then
96+
if [[ -d "$ANDROID_SDK_HOME/platform-tools" ]]; then
97+
echo "sdk.dir=$ANDROID_SDK_HOME" >>local.properties
98+
elif [[ -d "$ANDROID_SDK_HOME/../platform-tools" ]]; then
99+
echo "sdk.dir=$(realpath $ANDROID_SDK_HOME/../platform-tools)" >>local.properties
100+
fi
95101
elif [[ -n "$ANDROID_SDK" ]]; then
96102
echo "sdk.dir=$ANDROID_SDK" >>local.properties
97103
else

0 commit comments

Comments
 (0)