Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build command failed. #510

Closed
zeshaoaaa opened this issue Mar 26, 2018 · 10 comments
Closed

Build command failed. #510

zeshaoaaa opened this issue Mar 26, 2018 · 10 comments

Comments

@zeshaoaaa
Copy link

zeshaoaaa commented Mar 26, 2018

Description

Is there anyone know how to fix this problem? Thanks in advance.

Software

OS: Windows10

Error info

Build command failed.
Error while executing process C:\Users\Administrator\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Administrator\AndroidStudioProjects\WatermelonKnows\app -BC:\Users\Administrator\AndroidStudioProjects\WatermelonKnows\app.externalNativeBuild\cmake\debug\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\AndroidStudioProjects\WatermelonKnows\app\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\Administrator\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=C:\Users\Administrator\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Administrator\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
It fails with the following output:
Change Dir: C:/Users/Administrator/AndroidStudioProjects/WatermelonKnows/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp
Run Build
Command:"C:\Users\Administrator\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe"
"cmTC_2c138"
[1/2] Building C object CMakeFiles/cmTC_2c138.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_2c138
FAILED: cmd.exe /C "cd . &&
C:\Users\Administrator\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe
--target=armv7-none-linux-androideabi
--gcc-toolchain=C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64
--sysroot=C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/sysroot
-isystem
C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=15 -g -DANDROID -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -march=armv7-a
-mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb
-Wa,--noexecstack -Wformat -Werror=format-security
-Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a --sysroot
C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/platforms/android-15/arch-arm
-Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings
-Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack
-Qunused-arguments -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections
-Wl,-z,nocopyreloc CMakeFiles/cmTC_2c138.dir/testCCompiler.c.o -o
cmTC_2c138 -latomic -lm && cd ."
The system cannot find the path specified.
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "C:/Users/Administrator/AndroidStudioProjects/WatermelonKnows/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Administrator/AndroidStudioProjects/WatermelonKnows/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeError.log".
Build command failed.
Error while executing process C:\Users\Administrator\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Administrator\AndroidStudioProjects\WatermelonKnows\app -BC:\Users\Administrator\AndroidStudioProjects\WatermelonKnows\app.externalNativeBuild\cmake\release\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Administrator\AndroidStudioProjects\WatermelonKnows\app\build\intermediates\cmake\release\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=C:\Users\Administrator\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=C:\Users\Administrator\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Administrator\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
It fails with the following output:
Change Dir: C:/Users/Administrator/AndroidStudioProjects/WatermelonKnows/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeTmp
Run Build
Command:"C:\Users\Administrator\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe"
"cmTC_c924f"
[1/2] Building C object CMakeFiles/cmTC_c924f.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_c924f
FAILED: cmd.exe /C "cd . &&
C:\Users\Administrator\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe
--target=armv7-none-linux-androideabi
--gcc-toolchain=C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64
--sysroot=C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/sysroot
-isystem
C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=15 -g -DANDROID -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -march=armv7-a
-mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb
-Wa,--noexecstack -Wformat -Werror=format-security
-Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a --sysroot
C:/Users/Administrator/AppData/Local/Android/Sdk/ndk-bundle/platforms/android-15/arch-arm
-Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings
-Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack
-Qunused-arguments -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections
-Wl,-z,nocopyreloc CMakeFiles/cmTC_c924f.dir/testCCompiler.c.o -o
cmTC_c924f -latomic -lm && cd ."
The system cannot find the path specified.
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "C:/Users/Administrator/AndroidStudioProjects/WatermelonKnows/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Administrator/AndroidStudioProjects/WatermelonKnows/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeError.log".

@ggfan
Copy link
Contributor

ggfan commented Mar 26, 2018

not what I could see through it. if you comment out the detection in your CMakeLists.txt, while it get error later on? if you get a small portion of your app somewhere, that would be good. thanks

@zeshaoaaa
Copy link
Author

Does that help?
capture1

@ggfan
Copy link
Contributor

ggfan commented Mar 27, 2018

thanks! unfortunately I could not see through it. paste 2 files? .../.externaNativeBuild/cmake/debug/armeabi-v7a/cmake_build_command.txt
and cmake_build_output.txt

@ggfan
Copy link
Contributor

ggfan commented Mar 27, 2018

Got some expert mind: it might be that your SDK installed to a place that is too deep in the path, the overall path for some internal temp directory crossed 240 character limit, hence the error.

May you try one thing:

  1. do not change anything of your SDK location yet, try to import and build one NDK sample. See if you get the same error ( or you have no problem )
  2. map (or permanently move ) your sdk to somewhere closer to root dir( like C:\Android\sdk, or C:\sdk)

then check your Android Studio version and update here ( I tried to include that CakeTestCCompiler module in one of the sample's Cmakelists.txt, it is ok ).

@ggfan
Copy link
Contributor

ggfan commented Jul 9, 2018

assume you get this one nailed down already. It is an annoyance problem -- if it still happens on your end, please share the code somewhere, thanks

@ggfan ggfan closed this as completed Jul 9, 2018
@zeshaoaaa
Copy link
Author

@ggfan The problem is disappeared, thanks for your help!

@dvdinh307
Copy link

Hi @zeshaoaaa .
I have same problem.
Can you give some suggestion to fix this ?
Thanks for help !
DinhDV.

@l1uchao
Copy link

l1uchao commented Mar 20, 2019

Hi @zeshaoaaa .
I have same problem.Can you please give me some suggestions to solve the problems.Thank you.
Regards
liuchao.

@ggfan
Copy link
Contributor

ggfan commented Mar 21, 2019

this is more like compiler mis-match: cmake tries to generate a simple C/C++ program and compiling it to make sure the settings/compiling flags are correct.

It is pretty serious one, are you seeing this when you are compiling the sample? if you could cut out a simple program, please let me know. Also some details would help ( studio versions, ndk versions etc. )

@AndreyPesnyak
Copy link

AndreyPesnyak commented Jan 17, 2020

Hi @ggfan
Can you explain what you mean "are you seeing this when you are compiling the sample? if you could cut out a simple program, please let me know."?
I try to change ndk - the same error.

my path to sdk is near root - D:\AndroidSDK
Android studio 3.5.3
ndk 20.1.5948944
gradle version 5.4.1
android gradle plugin version 3.5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants