I am trying to integrate native (C++) OpenCV code into my project. I am following this project on github. After I click refresh linked C++ projects the compiler exits with exit code 1.
2:48 AM Gradle sync finished in 3 s 67 ms
2:48 AM C/C++ Configuration Problem
native-lib | debug | x86
Compiler exited with error code 1: /home/user/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -xc++ --target=i686-none-linux-android24 --gcc-toolchain=/home/user/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/user/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64/sysroot -Dnative_lib_EXPORTS -isystem /home/user/Downloads/forLinux/android studio/opencv-4.3.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -O0 -fno-limit-debug-info -fPIC -std=gnu++11 -fpch-preprocess -v -dD -E
Android (5900059 based on r365631c) clang version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 207d7abc1a2abf3ef8d4301736d6a7ebc224a290) (based on LLVM 9.0.8svn)
Target: i686-none-linux-android24
Thread model: posix
Dir: /home/user/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64/bin
Found candidate GCC installation: /home/user/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x
Found candidate GCC installation: /home/user/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/x86_64-linux-android/4.9.x
Selected GCC installation: /home/user/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x Candidate multilib: .;#m32
Selected multilib: .;#m32 clang++: error: no such file or directory: 'studio/opencv-4.3.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include'
The folder containing open-cv sdk had a space in its name. Removing the space solved the error.
Related
I'm trying to build POCO for Android (x86) with NetSSL_OpenSSL support which is not enabled by default. This is my configure line:
$ ./configure --config=Android
And this is my cmake line:
$ cmake -H. -B./poco-build-x86 -G'Ninja' -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/Users/me/Library/Android/android-ndk-r19c/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_ABI=x86 -DCMAKE_INSTALL_PREFIX:PATH=install-x86 -DOPENSSL_ROOT_DIR=/Users/me/dev/openssl-1.1.1g/install-x86/ -DOPENSSL_CRYPTO_LIBRARY=/Users/me/dev/openssl-1.1.1g/install-x86/lib -DOPENSSL_INCLUDE_DIR=/Users/me/dev/openssl-1.1.1g/install-x86 -DENABLE_CRYPTO=ON -DENABLE_NETSSL=ON
I'm getting this error at cmake time:
-- Checking for C++14 compiler
-- Checking for C++14 compiler - available
-- Could NOT find APR (missing: APR_INCLUDE_DIR APR_LIBRARY)
-- Could NOT find APRUTIL (missing: APRUTIL_INCLUDE_DIR APRUTIL_LIBRARY)
-- Could NOT find Apache2 (missing: APACHE2_INCLUDE_DIR)
-- Could NOT find MYSQL (missing: MYSQL_INCLUDE_DIR MYSQL_LIBRARY)
-- Could NOT find PostgreSQL (missing: PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR)
-- Could NOT find ODBC (missing: ODBC_LIBRARY ODBC_INCLUDE_DIR)
-- Building without tests & samples
-- Using internal sqlite, zlib, pcre, expat, ...
-- SQLite Support Enabled
-- MySQL Support Disabled
-- PostgreSQL Support Disabled
-- ODBC Support Disabled
-- CMake 3.10.2 successfully configured Poco using Ninja generator
-- Poco package version: 1.10.1
-- Building dynamic libraries
-- [cmake] Installation target path: install-x86
-- [cmake] Use toolchain file: /Users/juangarcia/Library/Android/android-ndk-r19c/build/cmake/android.toolchain.cmake
-- [cmake] Bulid for OS type: Android
-- [cmake] Build for OS version: 1
-- [cmake] Build for CPU type: i686
-- [cmake] Build type: Release
-- [cmake] Build with cxx flags: -O2 -DNDEBUG -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++
-- [cmake] Build with c flags: -O2 -DNDEBUG -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security
-- Building: Encodings
-- Building: XML
-- Building: JSON
-- Building: Util
-- Building: Net
-- Building: MongoDB
-- Building: Redis
-- Building: NetSSL_OpenSSL
-- Building: Crypto
-- Building: Data
-- Building: Zip
-- Building: PageCompiler
-- Building: File2Page
-- Configuring done
CMake Error at NetSSL_OpenSSL/CMakeLists.txt:16 (add_library):
Target "NetSSL" links to target "OpenSSL::SSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
...
What I'm doing wrong?
The solution for this question was use static libraries from OpenSSL. So, you need to link against .a instead of .so/.dylib. Something like:
cmake -H. -B./poco-build-x86 -G'Ninja' -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/Users/juangarcia/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja -DCMAKE_TOOLCHAIN_FILE=/Users/juangarcia/Library/Android/android-ndk-r19c/build/cmake/android.toolchain.cmake -DCMAKE_C_COMPILER=/Users/juangarcia/Library/Android/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -DCMAKE_CXX_COMPILER=/Users/juangarcia/Library/Android/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -DANDROID_NATIVE_API_LEVEL=24 -DANDROID_ABI=x86 -DOPENSSL_CRYPTO_LIBRARY=/Users/juangarcia/Downloads/openssl_111_android/lib/x86/libcrypto.a -DOPENSSL_SSL_LIBRARY=/Users/juangarcia/Downloads/openssl_111_android/lib/x86/libssl.a -DOPENSSL_USE_STATIC_LIBS=TRUE -DENABLE_NETSSL=TRUE -DOPENSSL_INCLUDE_DIR=/Users/juangarcia/Downloads/openssl_111_android/inc/x86 -DCMAKE_INSTALL_PREFIX=install-x86
You should note that in the command above, I'm setting CMAKE_INSTALL_PREFIX to auto install in a directory, but it is not necessary to solve the question.
I am trying to build an android native project using gradle. While the build passes for the architectures arm64-v8a, x86 and x86_64, it fails for armeabi-v7a with a unique error:
/{sdk-path}/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 -frtti -fexceptions -Os -DNDEBUG -O2 -DNDEBUG -D_NDEBUG=1 -s -fPIC -Wdeprecated-declarations -std=c++14 -MD -MT CMakeFiles/acplocalnet.dir/src/main/cpp/HttpTransferCallbackHookImpl.cpp.o -MF CMakeFiles/acplocalnet.dir/src/main/cpp/HttpTransferCallbackHookImpl.cpp.o.d -o CMakeFiles/acplocalnet.dir/src/main/cpp/HttpTransferCallbackHookImpl.cpp.o -c /Users/acpl/workspace/ACPLocal_net_Android/net/project/android/acplocalnet/app/src/main/cpp/HttpTransferCallbackHookImpl.cpp
clang++: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
error: unable to open output file '/apps/temp/HttpTransferCallbackHookImpl-baaa5e.s': 'No such file or directory'
1 error generated.
ninja: build stopped: subcommand failed.
The issue here is I am able to run this command and it builds the native libraries successfully when run the machine locally, but it fails when it is run through jenkins. The other amusing thing is that it fails only for the abi armeabi-v7a and passes for all other architectures.
I have verified the user, path and environment variables like ANDROID_HOME and ANDROID_NDK_HOME which are same when I run using the command line on the machine locally and when run using jenkins.
The command was not able to open the output files in the location "/apps/temp" as this directory was not present in the slave. This temp directory present in the jenkins master and was passed to the slave which was visible in the build variable TMP_DIR. Explicitly mentioning a valid temporary directory for the jenkins slave fixed the issue.
I have tried several days installing the NDK into Android Studio but it always gives me an error message saying that the build failed and I should install a c compiler. I installed the NDK via the SDK Manager by checking the NDK and C Make.
I have already tried completely reinstalling Android Studio and the NDK but that did not work as well -same error.
Something maybe worth mentioning is that if I do not check the C++ support during the project creation there are no errors(but no c++ support too:D).
What should I do because it kills my workflow?
Thank you very much
The Error Message:
Blockquote
External Native Build Issues
Build command failed.
Error while executing process C:\Users\Julius Debus\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Julius Debus\Desktop\MyApplication\app -BC:\Users\Julius Debus\Desktop\MyApplication\app.externalNativeBuild\cmake\release\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-21 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Julius Debus\Desktop\MyApplication\app\build\intermediates\cmake\release\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=C:\Users\Julius Debus\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS=-std=c++11 -frtti -fexceptions -DCMAKE_TOOLCHAIN_FILE=C:\Users\Julius Debus\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Julius Debus\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/Julius Debus/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/Julius Debus/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/Julius Debus/Desktop/MyApplication/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/Julius
Debus/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe"
"cmTC_a4b3d"
[1/2] Building C object CMakeFiles/cmTC_a4b3d.dir/testCCompiler.c.o
FAILED:
C:\Users\JULIUS~1\AppData\Local\Android\Sdk\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe
--target=armv7-none-linux-androideabi --gcc-toolchain="C:/Users/Julius
Debus/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
--sysroot="C:/Users/Julius
Debus/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem
C:/Users/Julius
Debus/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=21 -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 -fPIE -o
CMakeFiles/cmTC_a4b3d.dir/testCCompiler.c.o -c "C:\Users\Julius
Debus\Desktop\MyApplication\app.externalNativeBuild\cmake\release\armeabi-v7a\CMakeFiles\CMakeTmp\testCCompiler.c"
Error:Error:error: no such file or directory:
'Debus/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi'
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/Julius Debus/Desktop/MyApplication/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Julius Debus/Desktop/MyApplication/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeError.log".
Build command failed.
Error while executing process C:\Users\Julius Debus\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Julius Debus\Desktop\MyApplication\app -BC:\Users\Julius Debus\Desktop\MyApplication\app\.externalNativeBuild\cmake\debug\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-21 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Julius Debus\Desktop\MyApplication\app\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\Julius Debus\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS=-std=c++11 -frtti -fexceptions -DCMAKE_TOOLCHAIN_FILE=C:\Users\Julius Debus\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Julius Debus\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/Julius Debus/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/Julius Debus/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/Julius Debus/Desktop/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/Julius
Debus/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe"
"cmTC_82ebe"
[1/2] Building C object CMakeFiles/cmTC_82ebe.dir/testCCompiler.c.o
FAILED:
C:\Users\JULIUS~1\AppData\Local\Android\Sdk\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe
--target=armv7-none-linux-androideabi --gcc-toolchain="C:/Users/Julius
Debus/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
--sysroot="C:/Users/Julius
Debus/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem
C:/Users/Julius
Debus/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=21 -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 -fPIE -o
CMakeFiles/cmTC_82ebe.dir/testCCompiler.c.o -c "C:\Users\Julius
Debus\Desktop\MyApplication\app\.externalNativeBuild\cmake\debug\armeabi-v7a\CMakeFiles\CMakeTmp\testCCompiler.c"
Error:Error:error: no such file or directory:
'Debus/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi'
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/Julius Debus/Desktop/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Julius Debus/Desktop/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeError.log".
C:\Users\Julius Debus\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake
Warning:Warning:line (63) (include) CMakeLists.txt
Warning:Warning:line (63) (include) CMakeLists.txt
C:\Users\Julius Debus\AppData\Local\Android\Sdk\cmake\3.6.4111459\share\cmake-3.6\Modules\CMakeTestCCompiler.cmake
Error:Error:line (61)/Users/Julius Debus/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" is not able to compile a simple test program.
Open File
Error:Error:line (61)/Users/Julius Debus/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" is not able to compile a simple test program.
Open File
I cloned a project from a github repository and opened it in my Android Studio 3.0.
As soon as I open up Android Studio I get an Error:
Cannot load module file 'C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\Bookingtest.iml':
File C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\Bookingtest.iml does not exist
Would you like to remove module 'Bookingtest' from the project?
I don't understand why a file doesn't exist when I cloned the project right from the github.
Another Error that come up with the Gradle Sync is and External Native Build Issue.
External Native Build Issues
Build command failed.
Error while executing process C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app -BC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\release\armeabi -DANDROID_ABI=armeabi -DANDROID_PLATFORM=android-16 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\build\intermediates\cmake\release\obj\armeabi -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_TOOLCHAIN_FILE=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/David Ferrara/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/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/David
Ferrara/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe"
"cmTC_93f60"
[1/2] Building C object CMakeFiles/cmTC_93f60.dir/testCCompiler.c.o
FAILED:
C:\Users\DAVIDF~1\AppData\Local\Android\Sdk\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe
--target=armv5te-none-linux-androideabi --gcc-toolchain="C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
--sysroot="C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem
C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -march=armv5te
-mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack
-Wformat -Werror=format-security -fPIE -o
CMakeFiles/cmTC_93f60.dir/testCCompiler.c.o -c "C:\Users\David
Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\release\armeabi\CMakeFiles\CMakeTmp\testCCompiler.c"
Error:Error:error: no such file or directory:
'Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi'
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/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/CMakeOutput.log".
See also "C:/Users/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/CMakeError.log".
Build command failed.
Error while executing process C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app -BC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\debug\armeabi -DANDROID_ABI=armeabi -DANDROID_PLATFORM=android-16 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\build\intermediates\cmake\debug\obj\armeabi -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_TOOLCHAIN_FILE=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/David Ferrara/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/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/David
Ferrara/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe"
"cmTC_17c6b"
[1/2] Building C object CMakeFiles/cmTC_17c6b.dir/testCCompiler.c.o
FAILED:
C:\Users\DAVIDF~1\AppData\Local\Android\Sdk\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe
--target=armv5te-none-linux-androideabi --gcc-toolchain="C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
--sysroot="C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem
C:/Users/David
Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -march=armv5te
-mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack
-Wformat -Werror=format-security -fPIE -o
CMakeFiles/cmTC_17c6b.dir/testCCompiler.c.o -c "C:\Users\David
Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\debug\armeabi\CMakeFiles\CMakeTmp\testCCompiler.c"
Error:Error:error: no such file or directory:
'Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi'
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/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeOutput.log".
See also "C:/Users/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeError.log".
C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\share\cmake-3.6\Modules\CMakeTestCCompiler.cmake
Error:Error:line (61)/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" is not able to compile a simple test program.
Open File
Error:Error:line (61)/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" is not able to compile a simple test program.
Open File
I've tired to search for answers on this subject and have come across some answers that are similar to my question except they are not solutions for my specific question.
I'm stuck at a wall and don't know what to do to resolve this Error. All I want to do is clone a repo from github and work on the project in Android studio. All of my SDKs are installed.
This may be caused by the space in the folder C:/Users/David Ferrara/AppData/Local/
If so, it is likely a bug in Android Studio, CMake, or ninja
I installed android sdk, platform and build tools and NDK in my ArchLinux to develop with android-studio and c++. I've created a simple "hello world program" just to start but it is not compiling. The error message on build returned by android studio is "A problem occurred configuring project ':app'. executing external native build for cmake /home/fabio/AndroidStudioProjects/HelloWorld/app/CMakeLists.txt"
On the CMakeError.log:
Determining if the C compiler works failed with the following output:
Change Dir: /home/fabio/AndroidStudioProjects/HelloWorld/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeTmp
Run Build Command:"/opt/android-sdk/cmake/3.6.3155560/bin/ninja" "cmTC_be251"
[1/2] Building C object CMakeFiles/cmTC_be251.dir/testCCompiler.c.o
FAILED: /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv5te-none-linux-androideabi -gcc-toolchain /opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/opt/android-ndk/platforms/android-15/arch-arm -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -o CMakeFiles/cmTC_be251.dir/testCCompiler.c.o -c /home/fabio/AndroidStudioProjects/HelloWorld/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeTmp/testCCompiler.c
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directoryninja: build stopped: subcommand failed.
For the creation of the project, I just checked the option "Include c++ support" and started with a blank activity, changed no code then.
Edit Tryied instlalling libtinfo as suggested in this thread but didn't worked.
I experienced the same issue. Quite many of the other distributions often have outdated packages. They still use ncurses 5 instead of ncurses 6 (libtinfo seems to belong to ncurses). Assuming, that the android ndk's version of clang was built on such a system, it was worth a try to use ncurses 5. From the Arch User Repositories I was able to install the latest version of ncurses5-compat-libs (and I also installed the 32bit version: lib32-ncurses5-compat-libs). This solved the problem for me. If you have it installed already, try reinstalling or updating it, if it is outdated.