diff --git a/cli/src/android/build.ts b/cli/src/android/build.ts index 01cb5884b0..de9057df1e 100644 --- a/cli/src/android/build.ts +++ b/cli/src/android/build.ts @@ -35,17 +35,25 @@ export async function buildAndroid( } } + const releaseDir = releaseTypeIsAAB + ? flavor !== '' + ? `${flavor}Release` + : 'Release' + : flavor !== '' + ? join(flavor, 'release') + : 'release'; + const releasePath = join( config.android.appDirAbs, 'build', 'outputs', releaseTypeIsAAB ? 'bundle' : 'apk', - buildOptions.flavor ? `${flavor}Release` : 'release', + releaseDir, ); - const unsignedReleaseName = `app${ - config.android.flavor ? `-${config.android.flavor}` : '' - }-release${releaseTypeIsAAB ? '' : '-unsigned'}.${releaseType.toLowerCase()}`; + const unsignedReleaseName = `app${flavor !== '' ? `-${flavor}` : ''}-release${ + releaseTypeIsAAB ? '' : '-unsigned' + }.${releaseType.toLowerCase()}`; const signedReleaseName = unsignedReleaseName.replace( `-release${ diff --git a/cli/src/index.ts b/cli/src/index.ts index 9ac2ae59a9..187bf280c7 100644 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -174,6 +174,7 @@ export function runProgram(config: Config): void { platform, { scheme, + flavor, keystorepath, keystorepass, keystorealias, @@ -185,6 +186,7 @@ export function runProgram(config: Config): void { const { buildCommand } = await import('./tasks/build'); await buildCommand(config, platform, { scheme, + flavor, keystorepath, keystorepass, keystorealias,