Skip to content

Commit fcc5fc5

Browse files
committed
fix(cli): skip checks ndk when NDK_HOME set
1 parent 1afa9df commit fcc5fc5

File tree

1 file changed

+14
-0
lines changed
  • crates/tauri-cli/src/mobile/android

1 file changed

+14
-0
lines changed

crates/tauri-cli/src/mobile/android/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,20 @@ fn ensure_sdk(non_interactive: bool) -> Result<()> {
352352
}
353353

354354
fn ensure_ndk(non_interactive: bool) -> Result<()> {
355+
356+
// Return Ok if NDK_HOME is set by user and its path exists
357+
if let Some(ndk_home) = std::env::var_os("NDK_HOME").map(PathBuf::from) {
358+
if ndk_home.exists() {
359+
log::info!("Using NDK from NDK_HOME: {}", ndk_home.display());
360+
return Ok(());
361+
} else {
362+
crate::error::bail!(
363+
"NDK_HOME is set to {}, but the path does not exist.",
364+
ndk_home.display()
365+
);
366+
}
367+
}
368+
355369
// re-evaluate ANDROID_HOME
356370
let android_home = std::env::var_os("ANDROID_HOME")
357371
.map(PathBuf::from)

0 commit comments

Comments
 (0)