godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.67k stars 504 forks source link

Potential issues with Android builds? #1424

Open Connor-McCloskey opened 5 months ago

Connor-McCloskey commented 5 months ago

Godot version

4.2

godot-cpp version

4.2

System information

Windows 10

Issue description

Attempting to build this repo for Android seems to fail based on missing files. My understanding is that this are object files that should be generated during compilation, so I'm not sure why scons is getting into this state. Perhaps I'm doing something wrong? But this feels like it should be pretty straightforward.

Sample from scons output and the error:

D:\AndroidCL\latest\platform-tools/ndk/23.2.8568313/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -o src\core\memory.android.template_debug.arm64.o -c -fno-exceptions -std=c++17 --target=aarch64-linux-android21 -march=armv8-a -fPIC -O2 -fvisibility=hidden -DHOT_RELOAD_ENABLED -DANDROID_ENABLED -DUNIX_ENABLED -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -DNDEBUG -Igdextension -Iinclude -Igen\include src\core\memory.cpp

scons: *** [src\core\memory.android.template_debug.arm64.o] The system cannot find the file specified

scons: building terminated because of errors.

Steps to reproduce

  1. Ensure you have a cleaned repo (run scons --clean)
  2. Attempt an Android build (scons platform=Android)
  3. Observe output

Minimal reproduction project

N/A

Connor-McCloskey commented 5 months ago

I have my own small update for this, maybe someone else will find it helpful - up until now, I have been primarily running scons and my Godot build processes through the Windows command prompt. On a lark, I decided to try the same commands through Git Bash. Lo and behold, it suddenly starts working. That said, after talking with colleagues, I've encountered folks saying they've run into similar issues using *nix terminals as well. Considering that both these things should be equivalent in this use case, I'm kind of flabbergasted as to what the true issue is. This smells of either bad environment vars, a posix issue lurking in a build script, or some other unaccounted-for issue that I simply have no insight on.

Maybe that helps the team, maybe not. But I guess if anyone else encounters this, I'd suggest at least trying a different terminal to see if that helps.

luuuuyang commented 1 month ago

https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_for_android.html#setting-up-the-buildsystem image I had the same problem, because I was misled by the documentation. I set the ANDROID_HOME path to the Android command-line tools path, when it should be set to the Android SDK path