Android build failed

I’m runing ./gradlew build -PANDROID_ABI=armeabi-v7a
system: Windows 10

[216/953] Running utility command for rapidjson
FAILED: cmd.exe /C

???
ninja: build stopped: subcommand failed.

I guess when in Rome, do as the Romans do. Use gradlew.bat instead of ./gradlew.

:sweat_smile: I tried. Got follow errors.

– Detecting CXX compile features - done
CMake Error at E:/test/Urho3D-me/CMake/Modules/CheckCompilerToolchain.cmake:193 (message):
Could not check compiler toolchain as it does not handle ‘-E -dM’ compiler
flags correctly
Call Stack (most recent call first):
E:/test/Urho3D-me/CMake/Modules/UrhoCommon.cmake:123 (include)
CMakeLists.txt:46 (include)

– Configuring incomplete, errors occurred!
See also “E:/test/Urho3D-me/android/urho3d-lib/.externalNativeBuild/cmake/debug/armeabi-v7a/Source/Urho3D/tolua+±prefix/src/tolua+±build/CMakeFiles/CMakeOutput.log”.
ninja: build stopped: subcommand failed.

It’s a common pitfall for Windows host as our build system requires native compiler toolchain to be made available for host tool building. Read the online doc or do some search in the forum. Also make sure you are using master branch.

1 Like

Also try to nuke your old build tree before retrying. Sometime previous failed attempts may get in the way.

Still failed.

image

image
image

What is ‘native compiler toolchain’ ?

If you don’t understand what that meant, perhaps you should start by disabling the LUA subsystem first. Our build system tries to build host tool using native compiler toolchain in one go while crosscompiling. This has been asked and answered a few times in the forum. It gets old for me. So, I am sorry if my response is not very useful.

1 Like

I think this error not about lua.

image
I copy this command in a bat and run.
I got
image

command too long.

I changed my pc language to English. And rebuild Urho3d.
Got error message in English:
image

Yup, that’s another common pitfall for Windows users after managing to clear the compiler toolchain check. See New Gradle build system for Android platform. At this point I am also not sure why Windows 10 has this issue while it seems Windows 7 is fine.

1 Like

This pitfall was really heartbreaking for me :sweat:

I even tried the response file solution but it seems not to work ( I might probably be doing something wrong) so I actually gave it a break for a while. It would be nice if there could be a solution

:man_facepalming:
It’s called Linux.

2 Likes

:laughing::laughing::laughing:

2 Likes

It may worth your while by getting yourself familiar with Docker. Perhaps I should not say much until the whole thing materialized but there is a good chance Windows users (or as a matter of fact users on any hosts that could run docker image) would be able to pull Urho3d prepared docker image from Docker Hub that targets a specific platform, run it locally to build the project, and get the build artifacts as the result.