From 434e949c3b3ee679ab6066eaeb8cdf713b8c59e0 Mon Sep 17 00:00:00 2001 From: linl33 Date: Tue, 5 Jan 2021 12:20:38 +0800 Subject: [PATCH 1/2] Support non-default API 28 images --- .github/workflows/workflow.yml | 3 +++ lib/sdk-installer.js | 7 +++++-- src/sdk-installer.ts | 8 ++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 12fac2924..00e497187 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -36,6 +36,9 @@ jobs: - os: macos-latest api-level: 24 target: playstore + - os: macos-latest + api-level: 28 + target: google_apis steps: - name: checkout diff --git a/lib/sdk-installer.js b/lib/sdk-installer.js index 1ee861014..ecaeec09a 100644 --- a/lib/sdk-installer.js +++ b/lib/sdk-installer.js @@ -62,9 +62,9 @@ function installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cm if (!isOnMac && !fs.existsSync(sdkPreviewLicensePath)) { fs.writeFileSync(sdkPreviewLicensePath, '\n84831b9409646a918e30573bab4c9c91346d8abd'); } - // license required for API 30 system images + // license required for API 30 and non-default API 28 system images const sdkArmDbtLicensePath = `${process.env.ANDROID_SDK_ROOT}/licenses/android-sdk-arm-dbt-license`; - if (apiLevel == 30 && !fs.existsSync(sdkArmDbtLicensePath)) { + if (requiresArmDbtLicense(apiLevel, target) && !fs.existsSync(sdkArmDbtLicensePath)) { fs.writeFileSync(sdkArmDbtLicensePath, '\n859f317696f67ef3d7f30a50a5560e7834b43903'); } console.log('Installing latest build tools, platform tools, and platform.'); @@ -93,3 +93,6 @@ function installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cm }); } exports.installAndroidSdk = installAndroidSdk; +function requiresArmDbtLicense(apiLevel, target) { + return apiLevel === 30 || (apiLevel === 28 && target !== 'default'); +} diff --git a/src/sdk-installer.ts b/src/sdk-installer.ts index 3a899d0b3..ca1d36c31 100644 --- a/src/sdk-installer.ts +++ b/src/sdk-installer.ts @@ -36,9 +36,9 @@ export async function installAndroidSdk(apiLevel: number, target: string, arch: fs.writeFileSync(sdkPreviewLicensePath, '\n84831b9409646a918e30573bab4c9c91346d8abd'); } - // license required for API 30 system images + // license required for API 30 and non-default API 28 system images const sdkArmDbtLicensePath = `${process.env.ANDROID_SDK_ROOT}/licenses/android-sdk-arm-dbt-license`; - if (apiLevel == 30 && !fs.existsSync(sdkArmDbtLicensePath)) { + if (requiresArmDbtLicense(apiLevel, target) && !fs.existsSync(sdkArmDbtLicensePath)) { fs.writeFileSync(sdkArmDbtLicensePath, '\n859f317696f67ef3d7f30a50a5560e7834b43903'); } @@ -67,3 +67,7 @@ export async function installAndroidSdk(apiLevel: number, target: string, arch: await exec.exec(`sh -c \\"sdkmanager --install 'cmake;${cmakeVersion}' > /dev/null"`); } } + +function requiresArmDbtLicense(apiLevel: number, target: string): boolean { + return apiLevel === 30 || (apiLevel === 28 && target !== 'default'); +} From c3e261e13b4055874010a99713fcfb1d655a1924 Mon Sep 17 00:00:00 2001 From: Yang Date: Tue, 5 Jan 2021 18:28:29 +1100 Subject: [PATCH 2/2] Prepare for release 2.14.2. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18af4da41..b4f560cf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## v2.14.2 + +* Support API 28 system images with `google_apis` or `google_apis_playstore` target - [#117](https://github.com/ReactiveCircus/android-emulator-runner/pull/117). + ## v2.14.1 * Fix hang during AVD creation when `profile` is not specified - [#113](https://github.com/ReactiveCircus/android-emulator-runner/issues/113).