Skip to content

Commit 5de26e4

Browse files
committed
Merge branch 'main' into release/v2
* main: Prepare for release 2.19.1. Accept all Android SDK Licenses Adds Norris to the list of projects
2 parents ac874f3 + 5e487db commit 5de26e4

File tree

4 files changed

+9
-28
lines changed

4 files changed

+9
-28
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## v2.19.1
4+
5+
* Accept all Android SDL Licenses to fix `sdkmanager` installation. - [#172](https://github.com/ReactiveCircus/android-emulator-runner/pull/172) @marcuspridham.
6+
37
## v2.19.0
48

59
* Add option to specify `ram-size` for the AVD. - [#165](https://github.com/ReactiveCircus/android-emulator-runner/pull/165).

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,6 @@ These are some of the open-source projects using (or used) **Android Emulator Ru
200200
- [wikimedia/apps-android-wikipedia](https://github.com/wikimedia/apps-android-wikipedia/blob/master/.github/workflows)
201201
- [google/android-fhir](https://github.com/google/android-fhir/tree/master/.github/workflows)
202202
- [google/accompanist](https://github.com/google/accompanist/blob/main/.github/workflows)
203+
- [dotanuki-labs/norris](https://github.com/dotanuki-labs/norris/blob/master/.github/workflows/main.yml)
203204

204205
If you are using **Android Emulator Runner** and want your project included in the list, please feel free to create an issue or open a pull request.

lib/sdk-installer.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,8 @@ function installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cm
5959
core.addPath(`${cmdlineToolsPath}/latest:${cmdlineToolsPath}/latest/bin:${process.env.ANDROID_SDK_ROOT}/platform-tools`);
6060
// set standard AVD path
6161
core.exportVariable('ANDROID_AVD_HOME', `${process.env.HOME}/.android/avd`);
62-
// additional permission and license requirements for Linux
63-
const sdkPreviewLicensePath = `${process.env.ANDROID_SDK_ROOT}/licenses/android-sdk-preview-license`;
64-
if (!isOnMac && !fs.existsSync(sdkPreviewLicensePath)) {
65-
fs.writeFileSync(sdkPreviewLicensePath, '\n84831b9409646a918e30573bab4c9c91346d8abd');
66-
}
67-
// license required for API 30 and non-default API 28 system images
68-
const sdkArmDbtLicensePath = `${process.env.ANDROID_SDK_ROOT}/licenses/android-sdk-arm-dbt-license`;
69-
if (requiresArmDbtLicense(apiLevel, target) && !fs.existsSync(sdkArmDbtLicensePath)) {
70-
fs.writeFileSync(sdkArmDbtLicensePath, '\n859f317696f67ef3d7f30a50a5560e7834b43903');
71-
}
62+
// accept all Android SDK licenses
63+
yield exec.exec(`sh -c \\"yes | sdkmanager --licenses > /dev/null"`);
7264
console.log('Installing latest build tools, platform tools, and platform.');
7365
yield exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}' > /dev/null"`);
7466
console.log('Installing latest emulator.');
@@ -94,6 +86,3 @@ function installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cm
9486
});
9587
}
9688
exports.installAndroidSdk = installAndroidSdk;
97-
function requiresArmDbtLicense(apiLevel, target) {
98-
return apiLevel === 30 || (apiLevel === 28 && target !== 'default');
99-
}

src/sdk-installer.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,8 @@ export async function installAndroidSdk(apiLevel: number, target: string, arch:
3434
// set standard AVD path
3535
core.exportVariable('ANDROID_AVD_HOME', `${process.env.HOME}/.android/avd`);
3636

37-
// additional permission and license requirements for Linux
38-
const sdkPreviewLicensePath = `${process.env.ANDROID_SDK_ROOT}/licenses/android-sdk-preview-license`;
39-
if (!isOnMac && !fs.existsSync(sdkPreviewLicensePath)) {
40-
fs.writeFileSync(sdkPreviewLicensePath, '\n84831b9409646a918e30573bab4c9c91346d8abd');
41-
}
42-
43-
// license required for API 30 and non-default API 28 system images
44-
const sdkArmDbtLicensePath = `${process.env.ANDROID_SDK_ROOT}/licenses/android-sdk-arm-dbt-license`;
45-
if (requiresArmDbtLicense(apiLevel, target) && !fs.existsSync(sdkArmDbtLicensePath)) {
46-
fs.writeFileSync(sdkArmDbtLicensePath, '\n859f317696f67ef3d7f30a50a5560e7834b43903');
47-
}
37+
// accept all Android SDK licenses
38+
await exec.exec(`sh -c \\"yes | sdkmanager --licenses > /dev/null"`);
4839

4940
console.log('Installing latest build tools, platform tools, and platform.');
5041

@@ -73,7 +64,3 @@ export async function installAndroidSdk(apiLevel: number, target: string, arch:
7364
await exec.exec(`sh -c \\"sdkmanager --install 'cmake;${cmakeVersion}' > /dev/null"`);
7465
}
7566
}
76-
77-
function requiresArmDbtLicense(apiLevel: number, target: string): boolean {
78-
return apiLevel === 30 || (apiLevel === 28 && target !== 'default');
79-
}

0 commit comments

Comments
 (0)