Closed BastiaanOlij closed 1 year ago
@m4gr3d raised this so it stays on the radar, could use your feedback in case I'm doing something wrong with the AAR.
@BastiaanOlij I think I'm running into this same issue. Do you have an example of how to add a dummy project and instantiate is through the script? I'm not sure how to export an object from my .aar
file.
Thanks :)
@BastiaanOlij On second thought, I think that the issue that I'm running into may be different from yours. I'm building an Android plugin that doesn't have a native component, while yours has a native component.
That shouldn't matter for recognizing and embedding the AAR, just changes what is included and loaded. Note that many of my initial findings here were wrong. I probably should close this issue. The ARCore plugin (while not functional yet) does load properly now.
That said, this whole process could use some better documentation.
Ya, I think my problem must be different š Godot is seeing my Android plugin and letting me enable it, but when I call Engine.get_singleton("StepsPlugin")
, it always returns null
.
I'm closing this as outdated. We've been using AARs successfully for some time now (see OpenXR plugin in Godot 3 and OpenXR loaders in Godot 4)
Godot version
3.x (22a7e6b120569554ed065414f565bdf6dd3771cf)
System information
Windows/Android
Issue description
While working on the port of the ARCore functionality from the core PR to a GDNative plugin, noticed the plugin stopped loading even though the
.gdap
file is in place. Investigating the generated APK I can see the correct files are put into place.Best I can tell the difference is that we now remove the entry in the
project.godot
for the.gdnlib
file when this file is not present in the project:When plugins are build as an AAR file the
.gdnlib
file is encapsulated in the AAR file and not part of the project and thus not accessible by the editor.The Oculus mobile plugin that uses this same approach has several GDNative objects that are loaded through scripts and they trigger the load of the library. In the ARCore module we don't have objects initialised through
.gdns
files, we only have our XR singleton object.The workaround I'm using for now is that I've added a dummy object that needs to be instantiated through script to trigger the library load.
Steps to reproduce
Easiest is to compile the plugin discussed in this PR: https://github.com/GodotVR/godot_arcore/pull/6
Minimal reproduction project
https://github.com/GodotVR/godot_arcore/pull/6