Determine if building Android APK or AAB in Gradle

79 Views Asked by At

We have some dynamically included assets in our builds. When we build for firebase or for debugging via android studio, they are being included directly in the apk. When building for the play store they are being included via Play Asset Delivery, due to their size.

So the questions:

Is there built in mechanism in Gradle (version 6.7) to determine if the running build is building an app bundle (aab) or apk?

If there is no built-in mechanism, what are the best options that can be used via the various mechanisms (running, generating a signed bundle via Generate Signed Budle / APK, commandline), to determine the build product type?

1

There are 1 best solutions below

0
ruby6221 On

The build product is generated by different gradle task. You can build a apk file with the task named assembleDebug, and a aab file with the task named bundleDebug