This commit is contained in:
mslxl 2026-02-04 16:25:50 +08:00 committed by GitHub
commit 4ae49d009e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -344,6 +344,20 @@ fn ensure_sdk(non_interactive: bool) -> Result<()> {
}
fn ensure_ndk(non_interactive: bool) -> Result<()> {
// Return Ok if NDK_HOME is set by user and its path exists
if let Some(ndk_home) = std::env::var_os("NDK_HOME").map(PathBuf::from) {
if ndk_home.exists() {
log::info!("Using NDK from NDK_HOME: {}", ndk_home.display());
return Ok(());
} else {
crate::error::bail!(
"NDK_HOME is set to {}, but the path does not exist.",
ndk_home.display()
);
}
}
// re-evaluate ANDROID_HOME
let android_home = std::env::var_os("ANDROID_HOME")
.or_else(|| std::env::var_os("ANDROID_SDK_ROOT"))