diff --git a/.github/workflows/android-automated-sdk-install.yml b/.github/workflows/android-automated-sdk-install.yml index d32d08d67..e700b16b4 100644 --- a/.github/workflows/android-automated-sdk-install.yml +++ b/.github/workflows/android-automated-sdk-install.yml @@ -6,9 +6,11 @@ on: push: paths: - 'setup/prereq_android_sdk_install.sh' + - '.github/workflows/android-automated-sdk-install.yml' pull_request: paths: - 'setup/prereq_android_sdk_install.sh' + - '.github/workflows/android-automated-sdk-install.yml' schedule: # * is a special character in YAML so you have to quote this string - cron: '5 4 * * 0' @@ -71,7 +73,17 @@ jobs: export JAVA_HOME=$JAVA_HOME_11_X64 export ANDROID_SDK_ROOT=$NEW_ANDROID_SDK_ROOT echo "New SDK root $ANDROID_SDK_ROOT" + echo "About to run the emulator at $ANDROID_SDK_ROOT/emulator/emulator" $ANDROID_SDK_ROOT/emulator/emulator -list-avds + echo "About to run the avdmanager at $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager" + $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager list avds + + - name: Setup the cordova environment + shell: bash -l {0} + run: | + export JAVA_HOME=$JAVA_HOME_11_X64 + export ANDROID_SDK_ROOT=$NEW_ANDROID_SDK_ROOT + bash setup/setup_android_native.sh - name: Ensure that the path is correct and the project can be activated shell: bash -l {0} @@ -80,3 +92,5 @@ jobs: export ANDROID_SDK_ROOT=$NEW_ANDROID_SDK_ROOT echo "New SDK root $ANDROID_SDK_ROOT" source setup/activate_native.sh + echo "About to run the avdmanager from the path" `which avdmanager` + avdmanager list avd diff --git a/setup/activate_native.sh b/setup/activate_native.sh index 27a2cd99d..c0b8eb6e3 100644 --- a/setup/activate_native.sh +++ b/setup/activate_native.sh @@ -8,13 +8,14 @@ echo "Verifying $ANDROID_HOME or $ANDROID_SDK_ROOT is set" if [ -z $ANDROID_HOME ] && [ -z $ANDROID_SDK_ROOT ]; then echo "ANDROID_HOME and ANDROID_SDK_ROOT not set, android SDK not found" + exit 1 fi echo "Activating sdkman, and by default, gradle" source ~/.sdkman/bin/sdkman-init.sh echo "Ensuring that we use the most recent version of the command line tools" -export PATH=$ANDROID_SDK_ROOT/sdk/cmdline-tools/bin:$ANDROID_SDK_ROOT/emulator:$PATH +export PATH=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/emulator:$PATH echo "Configuring the repo for building native code" ./bin/configure_xml_and_json.js cordovabuild diff --git a/setup/setup_android_native.sh b/setup/setup_android_native.sh index 5b4ea6a4b..95dc9222e 100644 --- a/setup/setup_android_native.sh +++ b/setup/setup_android_native.sh @@ -13,7 +13,6 @@ JAVA_VERSION=`javac -version` echo "Found java in the path with version $JAVA_VERSION" echo "Setting up SDK environment" -ANDROID_BUILD_TOOLS_VERSION=27.0.3 MIN_SDK_VERSION=21 TARGET_SDK_VERSION=28