简体   繁体   中英

can't get started to use ndk android studio on archlinux

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.co 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_dd92 0.dir/testCCompiler.co -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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM