Forum > Android

LAMW + Android App Bundles

(1/2) > >>

Google's recommended way of publishing apps on the Play Store is not an APK, but an "App Bundle" (*.aab files).

Currently, the only way I can see to do that is with Android Studio.

But personally I like it very much that I can create my APK files with LAMW, with Ant or Gradle, using the script files (e.g. gradle-local-build.bat, gradle-local-apksigner.bat). That works perfectly and I don't need to mess with Android Studio at all.

So, can any one tell us if it's going to be possible to create AAB files as well as APK files from LAMW? Or with some script files? That would be great!

TLDR: A key advantage of the new AAB system is this. When you upload your apps to Google Play Store, you must typically include at least a 32 bit and a 64 bit version of But when users download it, they only need one or the other, not both. If you upload APKs, users will have to download everything (the "fat" APK). But with the new app bundle system, google removes what is not needed, so, for example, 32-bit devices will get an APK with only the 32 bit, and 64-bit devices will get an APK with only the 64 bit version of the same.

Similarly, I believe it is possible to specify that certain resources will be given to 32 bit devices, other resources to 64 bit devices, and so on.

I wouldn't be too surprised if at some point google will deprecate APK uploads and require everyone to only upload AAB files (Android App Bundles)

Bottom line, it would be nice to have a simple way to make AAB files.


The deadline is close – “Google Play Console” contains a warning:

--- Quote ---New Android App Bundle and target API level requirements in 2021
Mar 23, 2021
Starting August 2021, new apps will be required to target API level 30 (Android 11) and use the Android App Bundle publishing format. Starting November 2021, all app updates will be required to target API level 30 (Android 11). Apps with a download size of more than 150 MB are now supported by Play Asset Delivery and Play Feature Delivery.
--- End quote ---

--- Quote ---
New Android App Bundle and target API level requirements in 2021
19 November 2020
Posted by Hoi Lam, Developer Relations Engineer, Android Platform

In 2021, we are continuing with our annual target API level update, requiring new apps to target API level 30 (Android 11) in August and in November for all app updates. In addition, as announced earlier this year, Google Play will require new apps to use the Android App Bundle publishing format. This brings the benefits of smaller apps and simpler releases to more users and developers and supports ongoing investment in advanced distribution.
--- End quote ---

How to build "App Bundle" (*.aab files) files for “Google Play”?


--- Quote ---How to build "App Bundle" (*.aab files) files for “Google Play”?

--- End quote ---

Lazarus IDE --> "Tools"  --> "[LAMW]...." --> "Build Release......."

Maybe you will need do a "build" using aarch64, too. If true then go to Project Options --> [LAMW] ---> "Build"....

Thanks to jmpessoa for providing a way to build AAB files via the IDE.

A similar option exists within Android Studio. However, in that case, you need to have all your files and libraries within the typical Android Studio project folder structure, and in that case it may be tricky to maintain a LAMW project within both the Lazarus and the Android Studio folder structures at the same time.

Personally, my preferred and ideal solution is to have a one-click build script that is independent from any IDE. I use Lazarus with LAMW to write and test the project, but when it comes to the final build for public distribution, I prefer to have an independent script to do everything, which now includes creating the AAB file for Google Play.

Here I found Google's guidelines for creating an AAB file via command line. It uses Gradle, which in practice means to have Android Studio to be installed. But at least, one should be able to create AAB files with a script, without having to start the IDE, load the project, etc.

I am guessing that jmpessoa used the above guidelines to implement the same thing within LAMW.

And in addition to the above, if anyone has any suggestions, or examples of scripts they are using for building AAB files, I think that many people here, myself included, will appreciated it very much!

Unfortunately AAB building does not work (I am using Windows version of Lazarus).
When using the menu
Lazarus IDE --> "Tools"  --> "[LAMW]...." --> "Build Release......."
it creates “aab” file inside directory “\build\outputs\bundle\debug”,
however fails to create directory “\build\outputs\bundle\release”.
It launches batch commands inside “cmd” window, and at the end of batch processing it writes with red letters “BUILD FAILED” and then “cmd” window instantly disappears, so I am even unable to investigate what caused the error.
My question is: where are located *.bat files which produce AAB file? I need to fix these files which produce AAB file.
I suspect that these batch files use wrong directory/file names, and I need to fix that. The main problem of LAMW is that it creates *.bat files which use absolute paths instead of relative paths. When you move your project to another directory or rename project directory, all *.bat files stop working and you need to fix manually each *.bat file. This is inconvenient. It would be much better if generated *.bat files would contain relative paths instead of absolutes paths.


[0] Message Index

[#] Next page

Go to full version