Issue
I followed this page https://developer.android.com/ndk/guides/ to install the necessary to getting started. So I open new project as I do normally with checking c/c++ and blank example. when android studio open the main window, it can't build the default program by giving this error : External Native Build issues (2 errors).
this is the contents of the file CMakeOutput.log :
The target system is: Android - 1 - armv7-a The host system is: Linux - 4.17.6-1-ARCH - x86_64
and this is the contents of the file CMakeError.log :
Determining if the C compiler works failed with the following output: Change Dir: /home/abdelillah/AndroidStudioProjects/test/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp Run Build Command:"/home/abdelillah/Android/Sdk/cmake/3.6.4111459/bin/ninja" "cmTC_dd920" [1/2] Building C object CMakeFiles/cmTC_dd920.dir/testCCompiler.c.o FAILED: /home/abdelillah/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=armv7-none-linux-androideabi --gcc-toolchain=/home/abdelillah/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/abdelillah/Android/Sdk/ndk-bundle/sysroot -isystem /home/abdelillah/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 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -o CMakeFiles/cmTC_dd920.dir/testCCompiler.c.o -c /home/abdelillah/AndroidStudioProjects/test/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp/testCCompiler.c /home/abdelillah/Android/Sdk/ndk-bundle/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 directory ninja: build stopped: subcommand faile
other things, I can't edit "native-lib.cpp" directly in the main window, because it's not appear in the folder cpp in the left side even this file exist, I can see it using terminal. the following image show you what I mean IMAGE
I need help
Solution
This was an issue with some NDK binaries before r18: https://github.com/android-ndk/ndk/issues/574
r18 is unfortunately still in beta at time of writing, so it's not really a solution to your problem yet. You might be able to install specifically ncurses 5 on your system which should fix the problem, otherwise your best bet is to use a docker image or a VM based on Ubuntu for the time being.
Note that, in general, best compatibility for Android tools is going to be on Ubuntu/Debian. We fix issues for other distros when we can, but they are not actively tested to my knowledge.
Answered By - Dan Albert
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.