You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): detect Android env and install SDK and NDK if needed (#14094)
* feat(cli): detect Android env and install SDK and NDK if needed
changes the Android setup to be a bit more automated - looking up ANDROID_HOME and NDK_HOME from common system paths and installing the Android SDK and NDK if needed using the command line tools
* fix windows
* clippy
* lint
* add prmopts and ci check
* also check ANDROID_SDK_ROOT
Try to detect ANDROID_HOME and NDK_HOME environment variables from default system locations and install them if needed using the Android Studio command line tools.
anyhow::bail!("Java not found in PATH, default Android Studio Java installation not found at {default_java_home} and JAVA_HOME environment variable not set. Please install Java before proceeding");
242
+
}
243
+
}
244
+
245
+
Ok(())
246
+
}
247
+
248
+
fnensure_sdk(non_interactive:bool) -> Result<()>{
249
+
let android_home = std::env::var_os("ANDROID_HOME")
"Do you want to install the Android Studio command line tools to setup the Android SDK?",
297
+
Some(false),
298
+
)
299
+
.unwrap_or_default();
300
+
301
+
if !granted_permission_to_install {
302
+
anyhow::bail!("Skipping Android Studio command line tools installation. Please go through the manual setup process described in the documentation: https://tauri.app/start/prerequisites/#android");
"Do you want to install the Android SDK using the command line tools?",
311
+
Some(false),
312
+
)
313
+
.unwrap_or_default();
314
+
315
+
if !granted_permission_to_install {
316
+
anyhow::bail!("Skipping Android Studio SDK installation. Please go through the manual setup process described in the documentation: https://tauri.app/start/prerequisites/#android");
317
+
}
318
+
}
319
+
320
+
log::info!("Running sdkmanager to install platform-tools, android-{SDK_VERSION} and ndk-{NDK_VERSION} on {}...", default_android_home.display());
"Do you want to install the Android Studio command line tools to setup the Android NDK?",
371
+
Some(false),
372
+
)
373
+
.unwrap_or_default();
374
+
375
+
if !granted_permission_to_install {
376
+
anyhow::bail!("Skipping Android Studio command line tools installation. Please go through the manual setup process described in the documentation: https://tauri.app/start/prerequisites/#android");
"Do you want to install the Android NDK using the command line tools?",
385
+
Some(false),
386
+
)
387
+
.unwrap_or_default();
388
+
389
+
if !granted_permission_to_install {
390
+
anyhow::bail!("Skipping Android Studio NDK installation. Please go through the manual setup process described in the documentation: https://tauri.app/start/prerequisites/#android");
391
+
}
392
+
}
393
+
394
+
log::info!(
395
+
"Running sdkmanager to install ndk-{NDK_VERSION} on {}...",
0 commit comments