[Qbs] building android aab package help

Christian Kandeler christian.kandeler at qt.io
Wed Apr 15 09:47:48 CEST 2020


On Tue, 14 Apr 2020 21:27:18 +0200
Raphael Cotty <raphael.cotty at gmail.com> wrote:

> I am struggling to find a way to build the aab package (non runnable
> package required by google store) on the android platform.
> For this platform the default qbs product type is changed from application
> to android.apk (runnable package).
> What I am trying to achieve is allowing the user to just set a property in
> his project to enable the build of the aab package:

Note that the property should most probably be in the Android.sdk module instead.

> Building an aab is similar to building apk. They both take the same inputs
> (including java files) and generate a java file (R.java) but in a different
> way.
> 
> I first tried to add the android.aab type to the product type property in
> order to build both types.
> But I can't find a way to redirect all java files + the R.java apk to the
> next apk rule and all the java files + R.java aab to the next aab rule
> (without changing the java module).

I don't understand this part. What is a "next rule"? What do you mean by "redirect"?


>         // Let's gather all compiled java classes and generate the
> classes.dex
>         // If running in the apk context then we have all project java
> classes and the
>         // R.java generated in the apk context
>         // If running in the aab context then we have all project java
> classes and the
>         // R.java generated in the aab context

And what is the apk/aab "context"?
Are you saying you need to build both the APK and the AAB file? If so, what is the relationship between them?


Christian


More information about the Qbs mailing list