Generate .aab (Android application bundle) from Meteor project

Dhaval Chaudhary
Fasal Engineering
Published in
4 min readDec 20, 2019
visual explanation to Dynamic delivery used by .aab

In this post we will be discussing about how we can generate Android application bundle (.aab) from our Meteor Apps.

For this blog, I am using meteor 1.8 and assuming you have android studio already configured on your machine.

First we will build our meteor project.

For building project we use:

meteor build ../output --server=<your-server>

Once the build is completed, we will have the output directory outside our meteor project.

Now we will open Android studio, in the opening dialog box we have to select open an existing project option and load our android studio project from output/android/project.

Opening our built android studio project

Once we have android project ready. We might get recommendation to update android Gradle Plugin.

Just go ahead and press the update button and wait till it gets updated.

Gradle plugin update recommendation

Once update is finished We have to build project from build menu. Which gives some errors ( refer images below ).

Error after we build project
build error

Reason behind this error is updating Gradle plugin ( as we did in earlier steps ).

In newer version they have deprecated ‘<<’ and replaced it with ‘doLast’ operator. So no need to worry just follow the steps here.

https://stackoverflow.com/a/55793096/6318875

build.gradle code which you have to change for removing errors

After changing code of build.gradle file it will look some thing like this.

After updating << with doLast operator

Once it’s completed, try to build project once more. For me, Sadly I got the same error from another gradle file which is located somewhere in cordova-plugin-meteor-webapp/<yourapp>-build-extras.gradle.

It might come for you if you are using the same plugin.

If you are not getting error you can skip this step and move forward.

Here We will follow above steps and get rid of the error.

error
Location of gradle file where we are getting error
Code in which we are getting error

After replacing << with doLast operator we are ready to move and generate aab of the project.

For generating aab bundle of the project Follow these steps:

go to build menu and select option generate signed bundle /APK.

Option for generating bundle
Select android app bundle
Fill up your key-store and password here
Choose the path where you want your output

Once Android studio has done building, we will get success message like this.

Success! hurray!

Now we will be able to find .aab file in our output directory.

.aab bundle file

This is the file which you can upload to playstore. Congratulations 🤘.

Pat on the back!

Now if you are doing this for the first time and check it out if everything is working fine. You can use Playstore’s internal testing feature.

Release management tab from playstore

Go to manage and add your testers who can download and test the app.

Test group management from Playstore
Upload you .aab and release it for test

Once your update is live, you can start testing your application and prepare for a release.

If you want to generate APK file from your bundle here’s my blog which can be helpful.

We were able to reduce size of our app by 1.5 mb by uploading .aab rather than .apk.

People who are wondering why aab?

Check this out,

https://stackoverflow.com/questions/52059339/difference-between-apk-apk-and-app-bundle-aab

--

--