Android Studio Gradle Fail - android

I tried to build my android project, I got this error message.
Error while executing 'C:\Users\Chen\AppData\Local\Android\Sdk\cmake\3.6.3155560\bin\cmake.exe' with arguments {-HC:\Users\Chen\Desktop\Project\IPS-Competition-master-326592647c34e3535eb78372bea8ec1c58ca6160\IPS-Competition-master-326592647c34e3535eb78372bea8ec1c58ca6160\IPS_Android\app -BC:\Users\Chen\Desktop\Project\IPS-Competition-master-326592647c34e3535eb78372bea8ec1c58ca6160\IPS-Competition-master-326592647c34e3535eb78372bea8ec1c58ca6160\IPS_Android\app.externalNativeBuild\cmake\release\armeabi -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi -DANDROID_NDK=C:\Users\Chen\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Chen\Desktop\Project\IPS-Competition-master-326592647c34e3535eb78372bea8ec1c58ca6160\IPS-Competition-master-326592647c34e3535eb78372bea8ec1c58ca6160\IPS_Android\app\build\intermediates\cmake\release\obj\armeabi -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=C:\Users\Chen\AppData\Local\Android\Sdk\cmake\3.6.3155560\bin\ninja.exe -DCMAKE_TOOLCHAIN_FILE=C:\Users\Chen\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=15 -DCMAKE_CXX_FLAGS=}
-- Check for working C compiler: C:/Users/Chen/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/Chen/AppData/Local/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
-- Configuring incomplete, errors occurred!
CMake Error: Could not open file for write in copy operation C:/Users/Chen/Desktop/Project/IPS-Competition-master-326592647c34e3535eb78372bea8ec1c58ca6160/IPS-Competition-master-326592647c34e3535eb78372bea8ec1c58ca6160/IPS_Android/app/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/3.6.0-rc2/CMakeCCompiler.cmake.tmp
CMake Error: : System Error: No such file or directory
I've installed CMAKE, LLDB, NDK. Can I get some help?
Thanks.

I think you need to install compiler driver of c++.

Related

how do i get more information from a cmake failure in android studio?

android studio 2021.2.1 on win10pro
i just moved to a new machine, and just did a "git clone" to pull my project. when i try to build it i get the error message below.
it appears cmake is failing, but there is no indication of WHY it is failing. i looked at all the various files and paths handed to cmake, and they all appear to exist.
how do i get cmake to give me more information about what has gone wrong?
[CXX1405] error when building with cmake using C:\Users\Gorilla\github\sunclock\sunclock1\app\src\main\cpp\CMakeLists.txt: Build command failed.
Error while executing process C:\Users\Gorilla\AppData\Local\Android\Sdk\cmake\3.18.1\bin\cmake.exe with arguments {-HC:\Users\Gorilla\github\sunclock\sunclock1\app\src\main\cpp -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=26 -DANDROID_PLATFORM=android-26 -DANDROID_ABI=arm64-v8a -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DANDROID_NDK=C:\Users\Gorilla\AppData\Local\Android\Sdk\ndk\21.4.7075529 -DCMAKE_ANDROID_NDK=C:\Users\Gorilla\AppData\Local\Android\Sdk\ndk\21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=C:\Users\Gorilla\AppData\Local\Android\Sdk\ndk\21.4.7075529\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Gorilla\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Gorilla\github\sunclock\sunclock1\app\build\intermediates\cxx\Debug\14685u17\obj\arm64-v8a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=C:\Users\Gorilla\github\sunclock\sunclock1\app\build\intermediates\cxx\Debug\14685u17\obj\arm64-v8a -DCMAKE_BUILD_TYPE=Debug -BC:\Users\Gorilla\github\sunclock\sunclock1\app.cxx\Debug\14685u17\arm64-v8a -GNinja}

CMake/Android error: "not able to compile a simple test program"

I am trying to compile a CMake project for android.
I use QtCreator to create and compile the project. Using QMake works fine, but CMake projects don't work.
CMake Project parsing failed.
Running "C:\Android\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe -E server "--pipe=\\.\pipe\{78eb9a25-fbdf-4ac7-b840-8cfe89cbd883}" --experimental" in C:\Users\Thorsten\AppData\Local\Temp\QtCreator-Zmienl\qtc-cmake-KUabkXqG.
Starting to parse CMake project, using: "-DCMAKE_CXX_COMPILER:STRING=C:/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe", "-DCMAKE_C_COMPILER:STRING=C:/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe", "-DCMAKE_PREFIX_PATH:STRING=C:/Qt/5.13.0/android_x86_64", "-DQT_QMAKE_EXECUTABLE:STRING=C:/Qt/5.13.0/android_x86_64/bin/qmake.exe".
The CXX compiler identification is Clang 8.0.2
Check for working CXX compiler: C:/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
Check for working CXX compiler: C:/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -- broken
CMake Error at C:/Android/android-sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler
"C:/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Thorsten/AppData/Local/Temp/QtCreator-Zmienl/qtc-cmake-KUabkXqG/CMakeFiles/CMakeTmp
Run Build Command:"C:/Android/android-sdk/cmake/3.10.2.4988404/bin/ninja.exe" "cmTC_622f7"
[1/2] Building CXX object CMakeFiles/cmTC_622f7.dir/testCXXCompiler.cxx.obj
[2/2] Linking CXX executable cmTC_622f7.exe
FAILED: cmTC_622f7.exe
cmd.exe /C "cd . && C:\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe CMakeFiles/cmTC_622f7.dir/testCXXCompiler.cxx.obj -o cmTC_622f7.exe -Wl,--out-implib,libcmTC_622f7.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
clang++.exe: error: unable to execute command: program not executable
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:8 (project)
Configuring incomplete, errors occurred!
See also "C:/Users/Thorsten/AppData/Local/Temp/QtCreator-Zmienl/qtc-cmake-KUabkXqG/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Thorsten/AppData/Local/Temp/QtCreator-Zmienl/qtc-cmake-KUabkXqG/CMakeFiles/CMakeError.log".
CMake Project parsing failed.
I found several posts about this, but most of them were not answered or simply not useful. I found this helpful, so I added
SET (CMAKE_C_COMPILER_WORKS 1)
SET (CMAKE_CXX_COMPILER_WORKS 1)
before project(). But now I get
CMake Error in CMakeLists.txt:
No known features for CXX compiler
"Clang"
version 8.0.2.
CMake Project parsing failed.
So far I haven't found something useful for that.
I hope I can get some more help this way.
ps: I recently reinstalled my os (Windows 10), so if I forgot to update something it's not older than two month. I let QtCreator, Visual Studio and Android Studio do the installation of the toolchains.
pps: The project is a new project created by QtCreator

Docker. Build NDK project. The detected version of Ninja () is less than the version of Ninja required by CMake (1.3)

I have project that recently start using ndk. I have CI worked with Docker. After adding ndk to my project I added ndk to docker file, however for now I see problem with Ninja version.
Here's log output
-- Check for working C compiler: /android-ndk-linux/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
CMake Error:
The detected version of Ninja () is less than the version of Ninja required
by CMake (1.3).
CMake Error: Internal CMake error, TryCompile generation of cmake failed
-- Check for working C compiler: /android-ndk-linux/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- broken
CMake Error at /sdk/cmake/3.6.4111459/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler
"/android-ndk-linux/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" is not
able to compile a simple test program.
Did anyone faced with the same problem? Here's link for my docker file on docker hub https://cloud.docker.com/repository/docker/relgang/ndkfastlane

Cmake error when I create an new NDK project with androidstudio

AndroidStudio 3.1.4
NDK 17.2.4988734 ,r16b
cmake 3.6.4111459
I try to create an new Project with include C++ support.But the project is always build failed.
Build command failed.
Error while executing process D:\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HE:\workspace\android-ndk-master\Makeup\app -BE:\workspace\android-ndk-master\Makeup\app\.externalNativeBuild\cmake\release\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-24 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=E:\workspace\android-ndk-master\Makeup\app\build\intermediates\cmake\release\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=D:\Android\Sdk\androidndkr16b -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=D:\Android\Sdk\androidndkr16b\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=D:\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Configuring incomplete, errors occurred!
Parse error. Expected a command name, got unquoted argument with text "b".
Open File
Build command failed.
Error while executing process D:\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HE:\workspace\android-ndk-master\Makeup\app -BE:\workspace\android-ndk-master\Makeup\app\.externalNativeBuild\cmake\debug\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-24 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=E:\workspace\android-ndk-master\Makeup\app\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=D:\Android\Sdk\androidndkr16b -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=D:\Android\Sdk\androidndkr16b\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=D:\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Configuring incomplete, errors occurred!
Parse error. Expected a command name, got unquoted argument with text "b".
Open File
The problem has been solved.The global encryption software cause it.

Fail to create new Android NDK project

I want to learn how to write code in Android NDK.
I open the 'android studio guide' and on the 'create new ndk project' I follow the instruction.
I just create new project and add support for C++ code and that's it .. all the IDE code is in red and nothing can be compile.
Can't find any problem and I don't know what to do.
Tried to sync by clicking 'Try again' in first - and still fail.
The error message is:
CMake Error at
C:/Users/AppData/Local/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake:40
(cmake_minimum_required): CMake 3.6.0 or higher is required. You
are running version 3.4.1 Call Stack (most recent call first):
C:/Users/AppData/Local/Android/sdk/cmake/share/cmake-3.4/Modules/CMakeDetermineSystem.cmake:98
(include) CMakeLists.txt CMake Error: CMAKE_C_COMPILER not set,
after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after
EnableLanguage
-- Configuring incomplete, errors occurred! Build command failed. Error while executing process
C:\Users\AppData\Local\Android\sdk\cmake\bin\cmake.exe with arguments
{-HC:\WORKSPACE\Android\Practice\NDK\Practice_001\app
-BC:\WORKSPACE\Android\Practice\NDK\Practice_001\app.externalNativeBuild\cmake\debug\armeabi
-GAndroid Gradle - Ninja -DANDROID_ABI=armeabi -DANDROID_NDK=C:\Users\Rn\AppData\Local\Android\sdk\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\WORKSPACE\Android\Practice\NDK\Practice_001\app\build\intermediates\cmake\debug\obj\armeabi
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=C:\Users\AppData\Local\Android\sdk\cmake\bin\ninja.exe
-DCMAKE_TOOLCHAIN_FILE=C:\Users\AppData\Local\Android\sdk\ndk-bundle\build\cmake\android.toolchain.cmake
-DANDROID_PLATFORM=android-24 -DCMAKE_CXX_FLAGS=-frtti -fexceptions} CMake Error at
C:/Users/AppData/Local/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake:40
(cmake_minimum_required): CMake 3.6.0 or higher is required. You
are running version 3.4.1 Call Stack (most recent call first):
C:/Users/AppData/Local/Android/sdk/cmake/share/cmake-3.4/Modules/CMakeDetermineSystem.cmake:98
(include) CMakeLists.txt CMake Error: CMAKE_C_COMPILER not set,
after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after
EnableLanguage
-- Configuring incomplete, errors occurred!
Thanks for any help.
Click on the "Try again" in yellow banner. If you got the error still probably problem is with you do not have necessary library packages in your build.gradle file. Check if you have added necessary Support Library Packages in your build.gradle file. If doesn't then add it and "rebuild" your project.
Your error message is:
CMake 3.6.0 or higher is required. You are running version 3.4.1
I do not know whether you have your own CMake installation or you are attempting to use one that comes from Android Studio. My guess is that you have your own CMake installation. If so, upgrade it to 3.6.0 or higher.

Categories

Resources