From ead704cc5af993aed9531ff3d8d2e9ad796f4320 Mon Sep 17 00:00:00 2001 From: Yang Date: Sat, 12 Oct 2024 17:26:36 +1100 Subject: [PATCH] Fix avd path on ubuntu-24.04 - attempt 2 (#415) --- .github/workflows/main.yml | 4 ++-- lib/sdk-installer.js | 1 + src/sdk-installer.ts | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8d120b4ef..06c078931 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: api-level: 34 target: aosp_atd arch: x86_64 - - os: ubuntu-24.04 + - os: ubuntu-lastest api-level: 35 target: google_apis arch: x86_64 @@ -63,7 +63,7 @@ jobs: ~/.android/avd/* ~/.android/adb* ~/.android/debug.keystore - key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }} + key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.arch }} - uses: gradle/actions/setup-gradle@v4 diff --git a/lib/sdk-installer.js b/lib/sdk-installer.js index 21f355728..fe7f51385 100644 --- a/lib/sdk-installer.js +++ b/lib/sdk-installer.js @@ -63,6 +63,7 @@ function installAndroidSdk(apiLevel, target, arch, channelId, emulatorBuild, ndk // add paths for commandline-tools and platform-tools core.addPath(`${cmdlineToolsPath}/latest:${cmdlineToolsPath}/latest/bin:${process.env.ANDROID_HOME}/platform-tools`); // set standard AVD path + yield io.mkdirP(`${process.env.HOME}/.android/avd`); core.exportVariable('ANDROID_AVD_HOME', `${process.env.HOME}/.android/avd`); // accept all Android SDK licenses yield exec.exec(`sh -c \\"yes | sdkmanager --licenses > /dev/null"`); diff --git a/src/sdk-installer.ts b/src/sdk-installer.ts index fa0ee16fa..f87028a6f 100644 --- a/src/sdk-installer.ts +++ b/src/sdk-installer.ts @@ -32,6 +32,7 @@ export async function installAndroidSdk(apiLevel: string, target: string, arch: core.addPath(`${cmdlineToolsPath}/latest:${cmdlineToolsPath}/latest/bin:${process.env.ANDROID_HOME}/platform-tools`); // set standard AVD path + await io.mkdirP(`${process.env.HOME}/.android/avd`); core.exportVariable('ANDROID_AVD_HOME', `${process.env.HOME}/.android/avd`); // accept all Android SDK licenses