Skip to main content

Android App Bundle Adaptation

Overview

In 2018, Google launched Android App Bundle (AAB), a new publishing format for apps. According to the latest Google Play policy, new apps released after August 2021 must be published with Android App Bundle. For the moment, there are no changes for existing apps.

Image: Background

What is Android App Bundle?

Android App Bundle: A new publishing format released by Google. AAB differs from APK format because it allows Google Play to batch generate APKs for various device models. Therefore, users only need to download the appropriate APK for their actual device. This publishing format reduces the size of APKs and does not install unnecessary resources on user devices.

Play App Signing: Because Google Play now generates APK, Google Play also signs the app now.

Play Feature Delivery: Google's plug-in style delivery method. The feature model contains specific code, resources, and other content. Users may decide when to download and install them according to their needs.

Play Asset Delivery: Asset resources are delivered as distributed packages, replacing the previous APK Expansion File (OBB). Because Google Play limits APKs to 100MB, OBB files were previously used to solve the problems of excessive resources. However, OBB does not support signature verification and cannot load different resources for different devices. Therefore, Play Asset Delivery is used for asset distributed packaging.

Android App Bundle Format:

  • Base Module is the main package.
  • Dynamic Feature is for Play Feature Delivery.
  • Asset Pack is for Play Asset Delivery.

Image: AAB

Changes to Release Process

Image: AAB

Project Configuration Requirements

  • Android Studio version 3.2 or later
  • Gradle plugin version 3.2.1 or later
  • Google Play projects created after 08/01/2020 only support AAB format

Precautions for AAB Files Released on Google Play

Google Play officially supports updating APK format to AAB. You must replace the app signing key generated by Google and then release the new version.

Update AAB File

  • Update AAB format when creating new projects
    You can have Google Play generate an app signing key or use your own key to overwrite Google Play generated keys (Google recommends using Google Play App Signing).
  • Update existing APKs to AAB
    Use the existing APK to upload the signing key and then upload it to overwrite the app signing key generated by Google.

Update Google Play Signature File

  • Create a project with a Google Play signature file

    1. Go to Google Play Console.
    2. Select Testing > Internal testing.
    3. In the App integrity section, click Change app signing key.
    4. In the Change app signing key dialog box, click Use a different key. Image: AAB
    5. Select Export and upload a key from Java keystore and follow the instructions on the page to upload the signing key. Image: AAB
  • Update the Google Play signature file of an existing app

    1. Go to the Google Play Console.
    2. Select Setup > App integrity.
    3. In the Upgrade your app signing key for new installs section, click Request key upgrade. Image: AAB
    4. Select Use the same key for multiple app versions or the preinstalled version > Upload a new app signing key and follow the instructions on the page to upload the signing key. Image: AAB

Adaptation Solutions

  1. Apps with a total size of not more than 150MB:
    Simply select bundle when packaging. Nothing else changes. Because APK Expansion File (OBB) and Android App Bundle are incompatible, see 2 if you have already used OBB.

  2. Apps with OBB files and their resource files having a larger proportion of the total size:
    Follow the Asset Library documents to create a module used to store the resources previously placed in the OBB file. It is recommended to classify the resources into different modules. Based on the modules, create the asset packs that can be loaded as needed.

    • install-time: This asset pack is downloaded with the App and becomes available when the App is installed.
    • fast-follow: After the app is installed, Google Play will immediately resume downloading fast-follow asset packs. Because these packs are not always available, you need to check the status first.
    • on-demand: This asset pack is independently downloaded by the App as needed.
  3. Large Apps:
    Follow the Asset Library and Feature Library documents to divide the project into different modules and load resources based on module usage.

    • install-time: This feature module is downloaded with the app and becomes available when the app is installed.
    • on-demand: This feature module is independently downloaded by the app as needed.
    • conditional: This feature module is downloaded with the app when certain conditions are met, generally based on device hardware/software conditions such as resolution, system API version, or OpenGL version.
  4. Legacy Support:
    Although APIs with a level lower than 19 (Android 4.4) do not support installation by distributed packaging, Google Play can handle this situation. Google Play will still generate a more streamlined APK. It will not filter APKs by language but will filter them by resolution and CPU architecture. You must note that if a module is loaded in the on-demand method, you must assess whether the module should be fused. If so, set the fusing configuration to enable.

Customer Adaptation

Ensure that all the Player Network SDK modules must be in the main module or install-time module.

Pay attention to the feature module dependencies. If INTLCore is placed in Feature A and INTLFacebook is placed in Feature B, ensure that Feature A is loaded before calling Feature B. Otherwise, the app will crash due to missing code fragments and resources.