+1 vote

Hi there, having some trouble compiling the godot sourcecode for android on Windows OS. I am not using WSL.

Android SDK and NDK are installed. Environment Variables are set up correctly.
When i try to run scons command for android platform i get the error that android is not available as platform:

'PS E:\Repositories\godot\godot> scons platform=android target=release android_arch=arm64v8
scons: Reading SConscript files ...
Invalid target platform "android".
The following platforms were detected:

windows

Please run SCons again and select a valid platform: platform=<string>

Installed SDKs (API Level) are: 29, 26 and 24

Have no idea what is missing

in Engine by (13 points)

1 Answer

+1 vote

This occurs when scons cannot find the android sdk/ndk. The following environment variables need to be set:

ANDROID_HOME
ANDROID_NDK_HOME
ANDROID_NDK_ROOT

Example of paths on my windows machine with sdk/ndk install via android studio:

ANDROID_HOME=C:\Users\Ralph\AppData\Local\Android\Sdk
ANDROID_NDK_HOME=C:\Users\Ralph\AppData\Local\Android\Sdk\ndk\22.0.6917172
ANDROID_NDK_ROOT=C:\Users\Ralph\AppData\Local\Android\Sdk\ndk\22.0.6917172

Additionally, don't forget to restart your terminal after setting these variables.

by (16 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.