Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get core plugin working with Godot Android build template #21

Open
SanderVocke opened this issue May 20, 2021 · 3 comments
Open

Comments

@SanderVocke
Copy link

SanderVocke commented May 20, 2021

Note: I edited this issue since the first time I submitted this, because it was ranty and not very reproducible.

I have been unable to reproduce the "edit text sample" from this project in a separate Godot project, using Godot's own Android build template as a starting point. I am probably missing some key puzzle piece here.
It would be nice to have this working and then turn it into some steps described in GAST's documentation, because I expect that most people will want to use it in this way. Using Godot's built-in build template has advantages such as:

  • starting the app from within the Godot editor and being able to adapt properties such as the app name in there
  • using remote tree view in the editor.
  • Godot lib AAR is automatically provided in the build process, no need to build it yourself.

Steps taken:

  • create an empty Godot project.
  • create an Android run configuration with custom build (installed build template from within the editor)
  • copied the Godot project contents (scenes, resources, ...) from the Edit text sample Godot project in this repo
  • copied the Kotlin activity and app files from the Edit text sample (renamed to GodotApp) and put in the src folder in the custom build
  • some tweaks to the build.gradle of the custom build folder:
    • add dependency on gast-core .aar file built from this repo
    • add JNI path to .gdns files of GAST so they can be found

By this point, it is possible to run/debug the project on an Oculus Quest 2, both from Android Studio and from the Godot editor itself. however, the GAST nodes look black instead of having the expected contents shown on them.

Further investigation yielded that the onDraw callbacks to Gast views are never called.

@SanderVocke SanderVocke changed the title GAST node mesh stays black Cannot get core plugin working with Godot Android build template May 26, 2021
@SanderVocke
Copy link
Author

After a lot of trial and error, managed to find the magic that should go into the Android manifest to make this work:

<meta-data
            android:name="com.oculus.always_draw_view_root"
            android:value="true" />

(to be put under the application tag).

Apparently this tag is somehow added to the manifest during the build process of the Edit Text sample, merged from the GAST core lib. I didn't notice because I was only looking at the files in the sample folder itself - I didn't know that the final manifest is different than the initial one.

This tag can be added in the Godot-generated build template too.

@SanderVocke
Copy link
Author

I will keep the issue open, but feel free to close. The reason I think it would be good to keep this open is that it would be great to add some explanation of this to the README, or even another sample project that demonstrates "normal Godot Android usage" of the plugin, in line with the Godot instructions for Oculus Quest.

@curioussavage
Copy link

I know it's been a while but I'm stuck on this. I tried adding that meta-data tag in my godot android build manifest, but on exporting that tag is removed from the file. I tried adding it when I built the android plugins in this repo but it doesn't seem to be working because the gastnode is still just black

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants