diff --git a/ReactAndroid/hermes-engine/build.gradle b/ReactAndroid/hermes-engine/build.gradle index 61780e38b97a2a..6cbadca13fa9ff 100644 --- a/ReactAndroid/hermes-engine/build.gradle +++ b/ReactAndroid/hermes-engine/build.gradle @@ -101,10 +101,13 @@ android { compileSdkVersion 31 buildToolsVersion = "31.0.0" - // Used to override the NDK path & version on internal CI - if (System.getenv("ANDROID_NDK") != null && System.getenv("LOCAL_ANDROID_NDK_VERSION") != null) { - ndkPath System.getenv("ANDROID_NDK") - ndkVersion System.getenv("LOCAL_ANDROID_NDK_VERSION") + // Used to override the NDK path/version on internal CI or by allowing + // users to customize the NDK path/version from their root project (e.g. for M1 support) + if (rootProject.hasProperty("ndkPath")) { + ndkPath rootProject.ext.ndkPath + } + if (rootProject.hasProperty("ndkVersion")) { + ndkVersion rootProject.ext.ndkVersion } defaultConfig {