Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make use of Android App Bundle in Ionic Applications?

Hi i am Working with android applications , When i try to upload developer console says the message , "enter image description here"

I hope we can reduce the app size through it , I tried in different ways i cannot get idea for that. Please help me out. Is there any Posibilities to do that.

like image 309
Gopinath Kaliappan Avatar asked Apr 07 '19 06:04

Gopinath Kaliappan


People also ask

What is the use of Android App Bundle?

An Android App Bundle is a publishing format that includes all your app's compiled code and resources, and defers APK generation and signing to Google Play.

How do I create an AAB file in ion 3?

Generating an AAB in Android Studio To create an AAB binary locally using Android Studio, open the Build menu, then choose “Generate Signed Bundle / APK.” Follow the prompts to sign the AAB with your keystore file. For complete details, view the Android documentation.


2 Answers

Is supported natively in cordova-android >= 8.1.0

ionic cordova build android --prod --release -- -- --packageType=bundle

Note the extra -- -- dashes before --packageType. First -- is required by cordova. Second one is required because there is another cli tool between (ionic).

If you use cordova without ionic:

cordova build android --prod --release -- --packageType=bundle
like image 186
Matti Lehtinen Avatar answered Oct 10 '22 01:10

Matti Lehtinen


Edit: See Matti's answer below if you're on Cordova >= 8.1.0


You need to have "cordova-android": 8.0.0 or later.

  • run ionic cordova build android --prod --release as usual

  • change into the /platforms/android folder and run ./gradlew bundleRelease. On Windows, the file might be called gradlew.bat instead.

This outputs the bundle at /platforms/android/app/build/outputs/bundle/release/app.aab. Sign this bundle just like you would sign the APK and upload it to the Play Store.

like image 37
LyteFM Avatar answered Oct 10 '22 01:10

LyteFM