Skip to content

Conversation

@devloglogan
Copy link
Collaborator

This PR builds on top of the work in #15

For ease of review I've kept commits separate, including a commit that runs .clang-format on all of the c++ files. Some of the updates / additions to Fredia's work:

  • Updated the export process to check the new vendor plugin project settings.
  • generatePrebuiltApks now serves as a standalone task, it won't be run when building the plugin.
    • To run generatePrebuiltApks it needs to be pointed to a godot directory with -Pgodot_dir=path/to/godot
    • This will create a meta-export-template.zip file in the project root, with the idea that we'll host them here in releases of the Godot Meta Toolkit.
    • I've removed the godot submodule since it's now longer needed.
  • Added an editor tool that downloads/installs the export the prebuilt apks.
    • Download url is created form a new base url editor setting (default pointing towards this github repo) and I've added a GODOT_META_TOOLKIT_VERSION define in a new file version.h.

@devloglogan devloglogan force-pushed the apk-export-support branch 4 times, most recently from 8198f06 to fc442f0 Compare June 30, 2025 21:08
Copy link
Collaborator

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This looks great :-)

I've only got a couple notes/questions on the code

Otherwise, the only other important thing to note here is that this will only work with Godot 4.5 (because we need EditorExportPlugin::_update_android_prebuilt_manifest()) and so merging this will make the plugin 4.5+

We'll want to consider when we want to do this, or if we want to make two builds (one that's 4.3+ and another that's 4.5+), or maybe two major versions?

If we go with two builds, we could come up with a way to have a single codebase, where we wrap the new code with #if GODOT_VERSION_PATCH >= 5, which will check if the provided extension_api.json is for Godot 4.5 or later. Then we just need CI to make two builds with two different extension_api.jsons

build.gradle Outdated
Comment on lines 259 to 261
if (godotDir == "") {
throw new GradleException("godot_dir property is required")
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably check that the directory exists as well. And since this needs to be done in a bunch of places, it probably makes sense to move this check into a function

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added checking that it exists / is a directory, and extracted it out to a verifyGodotDir() function.

@devloglogan devloglogan force-pushed the apk-export-support branch 2 times, most recently from 1dc17a9 to cf444dd Compare July 1, 2025 18:33
@devloglogan devloglogan added the enhancement New feature or request label Jul 3, 2025
@dsnopek dsnopek added this to the 2.0.0 milestone Jul 11, 2025
m4gr3d and others added 4 commits July 28, 2025 15:31
The previous logic only uses `ANDROID_ENABLED` to gate the Platform SDK logic, which causes it to be active when the addon is loaded in the Android / XR editor.
The updated logic adds an editor specific build for the Android / XR editor which disables the Platform SDK logic.
Comment on lines +6 to +22
<activity
android:name=".GodotApp"
android:exported="true"
tools:node="merge">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

<!-- Enable access to OpenXR on Oculus mobile devices, no-op on other Android
platforms. -->
<category android:name="com.oculus.intent.category.VR" />

<!-- OpenXR category tag to indicate the activity starts in an immersive OpenXR mode.
See https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#android-runtime-category. -->
<category android:name="org.khronos.openxr.intent.category.IMMERSIVE_HMD" />
</intent-filter>
</activity>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be updated following the work in https://github.com/m4gr3d/godot/tree/add_front_door

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide more detail on this? That link doesn't appear to lead anywhere. 🙂

"XRInterface",
"ZIPReader"
]
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline.

break;
}

bool install_failed = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install_failed doesn't seem to be updated in the following logic.

overrides["gradle_build/min_sdk"] = "29"; // Android 10
overrides["gradle_build/target_sdk"] = "32"; // Android 12
} else {
overrides["gradle_build/use_gradle_build"] = false;
Copy link
Collaborator

@m4gr3d m4gr3d Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this given the progress being made on the gradle build and let's have the min_sdk and target_sdk reflect the values from above.

}

if (_get_bool_option("meta_xr_features/quest_3_support")) {
supported_devices.append("quest3");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +353 to +357
// Check for scene api.
bool use_scene_api = ProjectSettings::get_singleton()->get_setting_with_override("xr/openxr/extensions/meta/scene_api");
if (use_scene_api) {
r_permissions.append("com.oculus.permission.USE_SCENE");
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@m4gr3d m4gr3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some feedback to address, but it looks good overall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants