How to generate a godot-lib.aar file within a project?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MRimmer

I’m trying to get an application published on FDroid, however one big problem is that they don’t like having prebuilt binaries.

Godot’s Custom Build template contains a prebuilt binary used for building the APK, namely:

/android/build/libs/release/godot-lib.release.aar

I need to build the whole project from scratch, meaning I need to generate agodot-lib.aar file in place of this prebuilt. Is there any way of doing this?

:bust_in_silhouette: Reply From: Robster

Hi there,

Did you have any success with this? I’m looking to get my open source game into the FDroid store also but am not sure where to start or how to have Godot’s code work with their build system.

Thank you

:bust_in_silhouette: Reply From: joshsegall

I also had to generate my own godot-lib AAR files. The documentation certainly doesn’t make it clear how to do this, but here’s what worked for me:

I followed the instructions on compiling for Android:

Then from the godot/platform/android/java directory:

./gradlew copyDebugAARToBin
./gradlew copyReleaseAARToBin

This will copy the built AARs to the godot/bin directory. Note I’m using OSX so the command line syntax may differ on Windows.

I needed to do this to export my project for Android. Merely updating the APKs for custom builds doesn’t use the updated AARs. So I had to find the built AARs and copy them to the android/build/libs directory after installing the templates in my project.

I’m no sure if this is what you need for FDroid, I hope it helps.