Using the Android App Bundle with Visual Studio App Center



You might have heard about the new official publishing format for your Android apps: The Android App Bundle. Originally announced at Google I/O ‘18, this new format brings a host of new features and improvements for both you as a developer and your app’s users.

To get started it is important to recognize the Android App Bundle (or AAB for short) as a publishing format. It contains all resources and assets and binaries of your app for the respective publishing platform, i.e. the Play Store. You can’t install it directly on your Android device, but it is used to generate optimized binaries tailored for specific devices, i.e. screen densities, CPU architectures and locales.

This reduces both the download size of your app for most devices and the storage space your app consumes on the device.

One of the challenges is that while the Android App Bundle brings a lot of benefits for users of the Play Store, these are not directly available for users of other platforms. At the same time, since August 2019, the Play Store only accepts binaries supporting 64-bit for new uploads, and given that an AAB typically results in smaller individual binaries distributed to your users, the size limit for AABs is a much more forgiving 150MB per individual APK as the regular 100MB for plain APKs.

We’ve heard you loud and clear that being able to build and distribute AABs to supporting stores is important to you, and so we’re happy to announce that Visual Studio App Center supports building AABs for all supported Android platforms (regular Java/Kotlin, React-Native and Xamarin apps).

How to Build an AAB for your Android App

Building an Android App Bundle with App Center is straightforward and only requires one step:

Yes, that’s it. There’s a new switch in the build configuration of your Android app which allows you to build a bundle.

However, there’s a little more to it behind the scenes, of course. If our repository analysis detects that your app may use a bundle (i.e. through the bundle { … } block in your app’s Gradle configuration) we will enable this option by default.

In any case, what you select in the configuration will be respected, and if you chose to build a bundle, it will be built in addition to your regular APK.

Keep in mind that AABs for submission to the Play Store must also be signed, so we’re signing your AAB with the same key store and credentials as we’re signing your regular APK with.

If you look at the build’s details, you can then download the bundle if you so wish:

How to Distribute your AAB to the Store

So, you’ve built your app as an AAB, either through App Center, or locally, or through another CI pipeline. Now, how do you get it into the Play Store?

The simple answer here is you don’t have to do anything extra. If your build contains a bundle as an artifact, and you’re distributing it to a store which supports AAB (only Google Play as this time), App Center will automatically distribute the Android App Bundle.

This applies both to automatic distribution when you configure it for your build – or when distributing manually to the store.

In addition, when you configure distribution to the Play Store, but your app is not set up to produce an AAB, we will kindly let you know that AABs are preferred now:

You can still distribute APKs to the store of course if you chose, and keep in mind that App Center Distribution Groups still use the regular APK when distributing to them.

We’re excited to hear your feedback and the use cases you find to make sure your app is optimized for everyone using the Android App Bundle. Happy building!


Matthias Wenz

Follow Matthias