Skip to content

Automate Android & Java SDK setup - #121849

Open
m4gr3d wants to merge 1 commit into
godotengine:masterfrom
m4gr3d:use_android_cli_for_setup
Open

Automate Android & Java SDK setup#121849
m4gr3d wants to merge 1 commit into
godotengine:masterfrom
m4gr3d:use_android_cli_for_setup

Conversation

@m4gr3d

@m4gr3d m4gr3d commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What problem(s) does this PR solve?

This PR introduces the AndroidSdkManager class which is used to automate the download, setup and management of the Android and Java SDK in the Godot editor.

  • Android SDK setup: AndroidSdkManager downloads and uses the Android CLI to query, set up and update the Android SDK packages used by the Godot editor.
  • Java SDK setup: AndroidSdkManager checks for the presence of a valid Java SDK at the path specified in the Editor Settings, and if missing, it downloads and sets up a version of the Java SDK from https://adoptium.net/.
Screen.Recording.2026-07-28.at.12.31.25.AM.mov

The feature is made available in the Export Template Manager via the addition of a new Setup Android SDK button.
Advanced users still have the ability to set up and configure the Android and/or Java SDK on their own if desired.

The feature was tested on MacOs.

Remaining TODOs:

  • Testing and validation on Windows
  • Testing and validation on Linux

@m4gr3d m4gr3d added this to the 4.8 milestone Jul 28, 2026
@m4gr3d
m4gr3d requested review from a team as code owners July 28, 2026 07:57
@m4gr3d
m4gr3d force-pushed the use_android_cli_for_setup branch 2 times, most recently from 6941810 to f7218b5 Compare July 28, 2026 08:05
@syntaxerror247

syntaxerror247 commented Jul 28, 2026

Copy link
Copy Markdown
Member

The feature is made available in the Export Template Manager via the addition of a new Setup Android SDK button.

This doesn't seems like the right place for this button.
@m4gr3d I think, it might be better to place this button directly in Android preset. Thought?

Or, we can also go with the approach we had discussed:

  1. Update this menu option to "Setup Android Build Environment"
image
  1. And update this dialog to also have a button "Setup Andorid SDK" (if it's not already installed).
image

@m4gr3d
m4gr3d force-pushed the use_android_cli_for_setup branch 3 times, most recently from 0316cb0 to 9e543e0 Compare July 28, 2026 10:14
@m4gr3d
m4gr3d requested a review from a team July 28, 2026 10:23
@m4gr3d

m4gr3d commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

This doesn't seems like the right place for this button.
@m4gr3d I think, it might be better to place this button directly in Android preset. Thought?

Both the Install Android build template button and the export presets are project specific, whereas the Java and Android SDK are editor-wide setups. For that reason, the primary access needs to leave alongside other editor-wide settings / buttons / features.
The export preset window does surface the Manage Export Templates button when the Android / Java SDKs are not properly set up, which opens the 'Export Template Manager' allowing the user to complete the setup.

Suggestions for other locations are welcomed though. And I welcome input from the @godotengine/usability team.

@m4gr3d

m4gr3d commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

I'm running into errors extracting the Java SDK when testing on Windows.. Will dig into the issue tomorrow.

@m4gr3d
m4gr3d force-pushed the use_android_cli_for_setup branch from 9e543e0 to a1e8c10 Compare July 28, 2026 10:39
Comment on lines +53 to +54
"build-tools/35.0.1",
"platforms/android-35",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we be updating to version 36 of the build tools and platform?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants