diff --git a/lib/sdk-installer.js b/lib/sdk-installer.js index c57dea955..89839b27f 100644 --- a/lib/sdk-installer.js +++ b/lib/sdk-installer.js @@ -53,7 +53,9 @@ function installAndroidSdk(apiLevel, target, arch, channelId, emulatorBuild, ndk const isOnMac = process.platform === 'darwin'; const isArm = process.arch === 'arm64'; if (!isOnMac) { - yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME} -R`); + yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/platform-tools -R`); + yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/cmdline-tools/latest -R`); + yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION} -R`); } const cmdlineToolsPath = `${process.env.ANDROID_HOME}/cmdline-tools`; if (!fs.existsSync(cmdlineToolsPath)) { diff --git a/src/sdk-installer.ts b/src/sdk-installer.ts index 164fb3953..2b7364772 100644 --- a/src/sdk-installer.ts +++ b/src/sdk-installer.ts @@ -20,7 +20,9 @@ export async function installAndroidSdk(apiLevel: string, target: string, arch: const isArm = process.arch === 'arm64'; if (!isOnMac) { - await exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME} -R`); + await exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/platform-tools -R`); + await exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/cmdline-tools/latest -R`); + await exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION} -R`); } const cmdlineToolsPath = `${process.env.ANDROID_HOME}/cmdline-tools`;