This week, my Android App Bundle's size reached 161MB after introducing several new features. I was frightened that my aab's size exceeds the size limitation of Android App Bundles. But I tried to upload the oversize aab to the Google Play and it worked. I was confused and did many research to figure it out, here's what I got.
Can my Android App Bundle's size be over 150MB?
Yes, Android App Bundles's size can be over 150MB. As the official Android Developer Document Android App Bundles-Compressed download size restriction said, the total size of the compressed APKs required to install our app (for example, the base APK + configuration APKs) must be no more than 150 MB, rather than the Android App Bundles's size.
How to measure the size range of compressed APKs from my app bundle?
Although Android App Bundles's size can be over 150MB, we must be curious about the real size range of compressed APKs, as we wanna know the left available size for our app to use.
Fortunately, Google shared methods to estimate our app’s download size for a given device configuration. This is helpful to better understand the user experience of downloading our app and checking whether our app meets the compressed download size restriction for app bundles or enabling instant experiences.
After you build your Android App Bundle, you should test how Google Play uses it to generate APKs and how those APKs behave when deployed to a device. There are two ways you should consider testing your app bundle: locally using the bundletool
command line tool and through Google Play by uploading your bundle to the Play Console and using a test track.
When bundletool
generates APKs from your app bundle, it includes them in a container called an APK set archive, which uses the .apks
file extension. To generate an APK set for all device configurations your app supports from your app bundle, use the bundletool build-apks
command, as shown below.
bundletool build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks
To measure the estimated download sizes of APKs in an APK set as they would be served compressed over-the-wire, use the get-size total
command:
bundletool get-size total --apks=/MyApp/my_app.apks
My Android App Bundle /MyApp/my_app.aab
's size is 161MB. Here's the result I got from bundletool get-size total
command, which means the size range of compressed APKs from my app bundle is between 105632514 Bytes to 111835648 Bytes. 111835648 Bytes
is equal to 106.65MB
, which is less than 150MB
. Therefore, we figure out that my Android App Bundle have 43.35MB left available size to use.
bogon:bundletool happylee$ bundletool get-size total --apks=/MyApp/my_app.apks
MIN,MAX
105632514,111835648