AAB refers to Android App Bundles. As of now the only way to distribute App is to upload AAB files on Play Console. Earlier APK were uploadable.
I am not sure if we can create AAB from an APK. But I was able to create a Universal APK from the AAB file with the help of the Bundle Tool.
A Pull Request is in review to provide the “Export Signed Bundle” feature. The chances are we can see the feature in the upcoming days.
It is not officially merged in processing for android but you can test the branch by building it with wiki instructions given in the Processing for Android repository, which can be a lengthy process for a user.
For generating bundle now, I would suggest following the following steps:
Export Project from PDE with android mode.
Now you need to remove the SDK version lines in the manifest as it creates issues while signing( more info in the current thread).
Here there are two ways to open the project in Android studio. Either you can open the project directly or if it does not work properly due to Gradle version compatibilities you can create a new project in Android studio with the necessary project ID (i.e com.example.project) and then you can start replacing the folders such as java, resources, libs, asset, manifest file, etc from exported project to the newly created project in android studio.
At this point, if the files are replaced properly you can create signed bundles in Android Studio by signing with the existing Keystore or newly created keystore. In case the App is already published and you want to release an update you need to use the same Keystore file by which you signed the app earlier. Otherwise, you may face a publishing error while uploading the app on the play console. It would also be possible to use Keystore from PDE in Android Studio to sign APK or Bundles.
Earlier I was involved in some other work so was not able to reply. You can download and set Gradle as an environment variable. There are various ways to set the environment variables for various operating systems. The process would be quite similar to setup java in the system. After you would be able to use Gradle commands on the command line, you can export the project and navigate to the exported project’s folder in terminal or cmd based on your system. Now you can try to run the following command:
after that, the bundle would be generated at this location as
/sketchbook/project_name/android/app/build/outputs/bundle/release as “app-release.aab”
Genius teacher, thank you so much for your reply.
Where should I add that command?
I see what you’re talking about. But can you tell me how to add it?
I would appreciate it if you could tell me how to add ‘gradle bundleRelease’.
Hey there @Rupesh_Kumar
I’ve been trying to generate an .aab with the pull request you made to the Processing for Android code, but I’m struggling to make it work. Would you mind guiding me a bit through the process?
First of all, it doesn’t matter where I place your code, the option to export as .aab doesn’t show either way. Where exactly do I have to place the “processing-android” folder, inside C:\User\Documents\Processing\modes, or inside the project folder itself?
Thank you so much for keeping Processing for Android up to date.
Welcome to the community!
Placing the cloned “processing-android” from the repository and placing it inside the \modes would not work. Certain build instructions need to be followed which is mentioned on the wiki pages here - Building Processing for Android · processing/processing-android Wiki · GitHub to build and run the android mode(can be a little longer process for the first time). I have used the eclipse part to build and run the android mode. Please keep in mind that, as the code is not yet merged and is under review, the official Processing for Android release is more stable.
I just saw you have asked me something @GWAK
Gradle is a command-line utility that is used by android studio. You can use Gradle in command prompt or power shell of windows if the Gradle is set in environment variables. After navigating the command prompt to a specific folder of the project exported by Android Mode with ‘cd’. You can run the “gradle bundleRelease” and after you see build successful in the command line, The aab file will get generated at “ExportedProjectPath/app/build/outputs/bundle/release”
Unfortunately, I am unable to get this to work on a Mac (v.11.6 BigSur) with latest Processing version 4.0b8. Tools/Manage Tools/Modes states that Android mode 4.5.0 a4 is installed, but when I try to use it an error occurs:
In the second image, is there any more information present like classes line numbers and all? Can you share to check the origin of the error?
Please create a separate thread here or an issue at processing Android github repo with methods to reproduce the issue in detail if possible.