ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Add `--packageType` option to Ionic CLI

Open indraraj26 opened this issue 6 years ago • 8 comments

no description needed

indraraj26 avatar Oct 19 '19 12:10 indraraj26

I assume you're referring to --packageType for cordova-ios: https://cordova.apache.org/docs/en/latest/guide/platforms/ios/#using-flags

What is bundle?

imhoffd avatar Oct 22 '19 18:10 imhoffd

Hi,

Update to latest cordova cli and execute this cordova build android -- --packageType="bundle" this will create app-debug.aab file which will contain well optimize apk aka file for both architecture.

Now when you upload apk to google play console you might be getting warning that your app is not well optimized use bundle to optimize your app. With bundle your app size will be reduced/optimized based on architecture.

Issue thread discussion:

  1. https://github.com/apache/cordova-android/issues/729
  2. https://github.com/apache/cordova-android/issues/805

PR: https://github.com/apache/cordova-android/pull/764

indraraj26 avatar Oct 28 '19 07:10 indraraj26

Ah, yeah. The new Android App Bundles.

What is the specific actionable item for the Ionic CLI here? Using ionic cordova build android -- -- --packageType="bundle" should work. An additional option separator is required because it's wrapping yet another CLI. See the docs for more info.

imhoffd avatar Oct 28 '19 15:10 imhoffd

Thanks a lot @dwieeb. This works, since it works i am closing this thread.

indraraj26 avatar Oct 29 '19 06:10 indraraj26

Since Android App Bundles are going to be a more common feature, it may make sense to escalate --packageType as a documented option in the Ionic CLI.

imhoffd avatar Oct 29 '19 15:10 imhoffd

Hey @dwieeb any ETA for this feature in Ionic Applow packaing?

timbru31 avatar Nov 13 '19 17:11 timbru31

My colleague says no current ETA. We'll likely support it in the Ionic CLI first, so be sure to subscribe.

imhoffd avatar Nov 13 '19 19:11 imhoffd

As bundle is now the default, it would be useful to have this option to be able to build an apk easily

Today this works : ionic cordova build android --release -- -- --packageType=apk This would be great : ionic cordova build android --release --packageType=apk

QuentinFarizon avatar Jan 12 '22 21:01 QuentinFarizon