Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Setting Android releaseType in capacitor.config.ts has not effect #6199

Closed
pwespi opened this issue Dec 29, 2022 · 1 comment · Fixed by #6205
Closed

bug: Setting Android releaseType in capacitor.config.ts has not effect #6199

pwespi opened this issue Dec 29, 2022 · 1 comment · Fixed by #6205
Labels
platform: android type: bug A confirmed bug report

Comments

@pwespi
Copy link
Contributor

pwespi commented Dec 29, 2022

Bug Report

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 4.6.1
  @capacitor/core: 4.6.1
  @capacitor/android: 4.6.1
  @capacitor/ios: 4.6.1

Installed Dependencies:

  @capacitor/cli: 4.6.1
  @capacitor/core: 4.6.1
  @capacitor/ios: 4.6.1
  @capacitor/android: 4.6.1

Platform(s)

  • Android

Current Behavior

I'd like to build an APK (not AAB). So I set the following config and found that the releaseType has no effect.

capacitor.config.ts

import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  android: {
    buildOptions: {
      keystorePath: 'something.keystore',
      keystorePassword: process.env['KEYSTORE_PASSWORD'],
      keystoreAlias: 'something',
      keystoreAliasPassword: process.env['KEYSTORE_ALIAS_PASSWORD'],
      releaseType: 'APK',
    },
  },
};

export default config;

When running npx cap build android, it is still building an AAB.

I think the reason is because the command line flag has a default option:

.default('AAB'),

So when not setting the release type via command line flag, it is set to 'AAB' (the default option) and the value from the config file is never used.

Expected Behavior

Should build APK when releaseType is set to APK in config file and no command line flag is passed.

Code Reproduction

Set releaseType in capacitor.config.ts to 'APK' in any capacitor project.

Run npx cap build android.

Other Technical Details

npm --version output: 8.19.2

node --version output: 16.18.0

pod --version output (iOS issues only):

Additional Context

Using the command line flag works as expected:
npx cap build android --androidreleasetype APK

@ionitron-bot
Copy link

ionitron-bot bot commented Feb 5, 2023

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: android type: bug A confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants