Skip to content

Commit

Permalink
Update build-android.js to use the ANDROID_HOME environment variable
Browse files Browse the repository at this point in the history
According to https://developer.android.com/tools/variables `ANDROID_SDK_ROOT` is deprecated.
  • Loading branch information
kraenhansen authored Jan 22, 2024
1 parent 4408591 commit 1526ee0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/build-android.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ const packageRoot = path.resolve(__dirname, "..");

const NDK_VERSION = "25.1.8937393";

const { ANDROID_SDK_ROOT } = process.env;
if (!fs.existsSync(ANDROID_SDK_ROOT)) {
console.error(`Missing the Android SDK ${ANDROID_SDK_ROOT}`);
const { ANDROID_HOME } = process.env;
if (!fs.existsSync(ANDROID_HOME)) {
console.error(`Missing the Android SDK ${ANDROID_HOME}`);
process.exit(1);
}

const ndkPath = path.resolve(ANDROID_SDK_ROOT, "ndk", NDK_VERSION);
const ndkPath = path.resolve(ANDROID_HOME, "ndk", NDK_VERSION);
if (!fs.existsSync(ndkPath)) {
const cmd = `sdkmanager --install "ndk;${NDK_VERSION}"`;
console.error(`Missing Android NDK v${NDK_VERSION} (${ndkPath}) - run: ${cmd}`);
Expand Down

0 comments on commit 1526ee0

Please sign in to comment.