Today I wanted to try compiling a CGE project for Android. I’m following this guide.
However, I can’t figure out how to tell the engine where my Android SDK is. I downloaded “Android Studio Panda 2” and even “Android Command Line Tools,” but I can’t find inside it any subdirectories like “tools“ and “platform-tools”. I’m completely at a loss as to what to do.
I have’t used Android SDK for a long time but from what I remember after you install “android command line tools” you have to run sdkmanager and pick a SDK version to install (depend on your target android version there’re a lot to choose)
You should choose one or the other – either install the full “Android Studio” (which is our recommendation for some time now), or install only the “Android Command-line Tools” (which was our recommendation few years ago, but I changed it, as Android Studio has a few nice things above the cli tools, and makes the process easier for most people).
Once you have Android Studio, run it and it will get latest Android SDK automatically. You should see the SDK location in “File → Settings → Languages & Frameworks → Android SDK” . See the " Install Android SDK (optionally: along with Android Studio)" section on the docs Android | Manual | Castle Game Engine .
So, to further troubleshoot, I recommend:
Get “Android Studio”. Don’t get “Android Command-line Tools”, remove them if you have them – they will confuse things You only need Android Studio, and it will install the rest.
Run Android Studio, it should prompt to install Android SDK.
Take a look at the screenshot in section " Install Android SDK (optionally: along with Android Studio)" of the docs and see how it looks on your side If all goes well, this should contain Android SDK directory, with subdirs like “tools“ and “platform-tools”. If it does not, show us
what this dialog, “File → Settings → Languages & Frameworks → Android SDK”, shows for you
if it shows any directory, show the contents of that directory.
fpc 3.3.1
I couldn’t build either, but the project was created, I have to manually set the path to the sdk in local.properties and build manually through android studio. Maybe I’m doing something wrong
Make a separate forum thread This may be an unrelated issue, so having it mixed here could make the resolution harder.
Give us details what you did, and how it doesn’t work. Describe did you do all steps from Android | Manual | Castle Game Engine , did you use “Android Command-Line Tools” or “Android Studio”, did you set Android SDK path, and in the end how do you try to build for Android and how it doesn’t work. Please attach screenshots and copy-paste error messages where possible → the more precise information I get, the better I can help
Hey i was going through the same problem. what worked for me is downloading the SDK directly. and pointing to the SDK directly through the preferences. Had an AI like Chatgpt or Gemini help set up SDK since you need to alter location of some file i can’t remember what. I remember asking the AI to help download NDK 25 using cli and it suggested changes. Hope you too figure it out
Indeed, any way of getting “Android SDK” will work.
I still recommend everyone to:
just get “Android Studio”, which will then get Android SDK and take care of additional things (license questions, updating the SDK, connecting to devices over wifi).
Follow our docs and if something fails – please report exactly what you did, at which step you’re stuck, what error message you get Then we can improve the docs to make everything better.
For everyone who has a problem with Android requisites installation: I feel you, and I want to help!, but for this I need to know the details: did you do all steps from our docs and if something failed in this process → how it failed, with what error message.
I regularly build CGE applications for Android, following our docs I setup Android environment on Windows and Linux, so I’m certain the process should work
Note that if you use AI for help with modifying your system, at least:
make it provide justification for commands it runs,
double-check the commands makes sense,
keep a log of commands executed, and how in effect your resulting installation differs from “normal installation”.
Basically, just like before AI it was a bad idea to “execute random commands from StackOverflow”, it is now a bad a idea to “just let AI execute random commands” The result may work, but may also contain random missing pieces, making it harder to debug what’s wrong.
As for “help download NDK 25 using cli” – note that this is not something you should ever need to do. Proper NDK, with proper version, should be downloaded automatically when building the CGE application (by Gradle, Android build process, which is called by CGE build tool). If it was not, we should debug why it was not (what did you do, what error messages did you get).