-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Description
Describe the problem
Latest Tauri versions try to build using the latest NDK which is installed in the system - not the specified NDK through the NDK_HOME variable. This means it's impossible to reproduce a build within build systems, and this adds unnecessary friction should developers want their apps to be reproducible by others (such as the guys over at F-Droid / IzzyOnDroid.)
Describe the solution you'd like
If NDK_HOME is set, Tauri should honor that instead of trying to get the latest NDK from $ANDROID_HOME/ndk.
Ref:
tauri/crates/tauri-cli/src/mobile/android/mod.rs
Lines 347 to 365 in 3257612
| // re-evaluate ANDROID_HOME | |
| let android_home = std::env::var_os("ANDROID_HOME") | |
| .or_else(|| std::env::var_os("ANDROID_SDK_ROOT")) | |
| .map(PathBuf::from) | |
| .context("Failed to locate Android SDK")?; | |
| let mut installed_ndks = read_dir(android_home.join("ndk")) | |
| .map(|dir| { | |
| dir | |
| .into_iter() | |
| .flat_map(|e| e.ok().map(|e| e.path())) | |
| .collect::<Vec<_>>() | |
| }) | |
| .unwrap_or_default(); | |
| installed_ndks.sort(); | |
| if let Some(ndk) = installed_ndks.last() { | |
| log::info!("Using installed NDK: {}", ndk.display()); | |
| std::env::set_var("NDK_HOME", ndk); | |
| } else if non_interactive { |
Alternatives considered
No response
Additional context
No response
Reactions are currently unavailable