godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Allow Android SDK via CLI argument or environment variable. #9349

Open moberer opened 5 months ago

moberer commented 5 months ago

Describe the project you are working on

Game to be exported to Android.

Describe the problem or limitation you are having in your project

Android SDK location cannot be set locally, per project. Android SDK location can not be set in an automated way.

This means manual steps are required for every developer trying to export the project to android.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Allow the Android SDK Path to be set

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

E.g.:

If this enhancement will not be used often, can it be worked around with a few lines of script?

Unfortunately not really.

Developers would have to manually change the Android SDK path in the settings every time.

Is there a reason why this should be core and not an add-on in the asset library?

Not possible to implement. (To my knowledge)

Calinou commented 5 months ago

The ANDROID_HOME environment variable is already read by the Android export code: https://github.com/godotengine/godot/blob/7d151c83811f8ac8873439826c16d88c83aba12f/platform/android/export/export.cpp#L47

The same applies to JAVA_HOME.

Have you tried setting it before starting the Godot editor? If you set it on a separate line, make sure to use export ANDROID_HOME="...".

moberer commented 5 months ago

Unfortunately, this does not seem to work.

grafik

(The same path works, if I set it in the Godot settings)

If this is intended to work (which I was unsure about, since it isn't really documented anywhere), I think I should open an issue with Godot-proper.

Calinou commented 5 months ago

cc @m4gr3d