fix(ci): ensure Android SDK licenses are accepted automatically

Relies solely on `yes | sdkmanager --licenses` to accept licenses during the Zapstore publish workflow, removing potentially outdated manual hash entries and ensuring the command output is visible for debugging.
This commit is contained in:
dave 2025-04-04 14:03:30 +03:00
parent a7e472755e
commit 5e3ce48f4f

@ -60,17 +60,18 @@ jobs:
export ANDROID_SDK_ROOT=$PWD/android-sdk
export PATH=$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin
# Accept licenses
yes | sdkmanager --licenses > /dev/null 2>&1 || echo "License auto-acceptance failed, continuing anyway"
# Ensure licenses directory exists before running sdkmanager
mkdir -p "$ANDROID_SDK_ROOT/licenses"
# Make sure to include the --sdk_root argument to avoid any prompts
mkdir -p $ANDROID_SDK_ROOT/licenses/
echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > $ANDROID_SDK_ROOT/licenses/android-sdk-license
echo "d56f5187479451eabf01fb78af6dfcb131a6481e" >> $ANDROID_SDK_ROOT/licenses/android-sdk-license
echo "24333f8a63b6825ea9c5514f83c2829b004d1fee" >> $ANDROID_SDK_ROOT/licenses/android-sdk-license
# Accept licenses forcefully
echo "Attempting to accept SDK licenses..."
yes | sdkmanager --licenses
echo "Finished attempting license acceptance."
# Install build tools with auto-accept
# Install build tools with auto-accept (keeping yes pipe as backup)
echo "Installing SDK components..."
yes | sdkmanager --sdk_root=$ANDROID_SDK_ROOT "platform-tools" "build-tools;33.0.2" "platforms;android-33"
echo "Finished installing SDK components."
# Create local.properties
echo "sdk.dir=$ANDROID_SDK_ROOT" > local.properties