fix(cli): Android build --apk and --aab flags requiring a value (#14629)

Co-authored-by: Fabian-Lars <github@fabianlars.de>
This commit is contained in:
Lucas Fernandes Nogueira
2026-01-19 16:32:43 -03:00
committed by GitHub
parent e919a760ed
commit 62aa13a124
3 changed files with 18 additions and 9 deletions

View File

@@ -0,0 +1,6 @@
---
"tauri-cli": patch:bug
"@tauri-apps/cli": patch:bug
---
Fix `android build`'s `--aab` and `--apk` flags requiring a value to be provided.

View File

@@ -64,10 +64,12 @@ pub struct Options {
pub split_per_abi: bool,
/// Build APKs.
#[clap(long)]
pub apk: Option<bool>,
pub apk: bool,
/// Build AABs.
#[clap(long)]
pub aab: Option<bool>,
pub aab: bool,
#[clap(skip)]
pub skip_bundle: bool,
/// Open Android Studio
#[clap(short, long)]
pub open: bool,
@@ -242,10 +244,10 @@ fn run_build(
noise_level: NoiseLevel,
tauri_dir: &Path,
) -> Result<OptionsHandle> {
if !(options.apk.is_some() || options.aab.is_some()) {
if !(options.skip_bundle || options.apk || options.aab) {
// if the user didn't specify the format to build, we'll do both
options.apk = Some(true);
options.aab = Some(true);
options.apk = true;
options.aab = true;
}
let interface_options = InterfaceOptions {
@@ -272,7 +274,7 @@ fn run_build(
inject_resources(config, tauri_config)?;
let apk_outputs = if options.apk.unwrap_or_default() {
let apk_outputs = if options.apk {
apk::build(
config,
env,
@@ -286,7 +288,7 @@ fn run_build(
Vec::new()
};
let aab_outputs = if options.aab.unwrap_or_default() {
let aab_outputs = if options.aab {
aab::build(
config,
env,

View File

@@ -101,8 +101,9 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> {
features: options.features,
config: options.config.clone(),
split_per_abi: true,
apk: Some(false),
aab: Some(false),
apk: false,
aab: false,
skip_bundle: false,
open: options.open,
ci: false,
args: options.args,