`How To Generate .AAR File for My Godot Project,I try to Generate a AAR file which will be used to call the Godot engine process in a specific APK. During the calling process, data needs to be transmitted to it and the lifecycle of the engine needs to be managed. Additionally, I would like to know how to compile the GDExtension - C++ module I created into this AAR file as well.
I’ve searched through a lot of materials and documents, but there’s no direct guidance. That’s why I come to the community for help. `
So you are trying to create a java library that provides an API to GodotEngine? I would consult Android docs for how to build one, and modify your android project to build it.
Concerning GDExtension, im sure you have seen the Godot docs?
I can only guess, but if your library is only going to be used with Godot, there may be no advantage to building an AAR library.
I have read the documentation of GDExtension and learned how to compile the.so library for use in an.aar file, and I’ve also implemented it. However, in fact, the.aar file is just one part of my project. It needs to receive external real-time data into Godot for optimization. Compared with Unreal, there is very little documentation on this aspect in Godot.
Or may I ask if you have a better solution? If so, I would be extremely grateful.
If you are trying to compile GDExtension, you need to first compile the engine to download the NDK, then you can compile GDExtension.
Then there is your way warping a native library in a aar manually, but you should just use the first or second method depending on your goal. As you would need to create your own glue layer to communicate between Android and Godot ecosystems in this third method.