无法开始在 archlinux 上使用 ndk android studio

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

我按照此页面 https://developer.android.com/ndk/guides/ 安装了入门所需的内容。 所以我像往常一样打开新项目,检查 c/c++ 和空白示例。 当 android studio 打开主程序 window 时,它无法通过给出此错误来构建默认程序: 外部本机构建问题(2 个错误)。

这是文件的内容 CMakeOutput.log :

The target system is: Android - 1 - armv7-a The host system is: Linux - 4.17.6-1-ARCH - x86_64

这是文件的内容 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

其他的东西,我不能直接在主window中编辑"native-lib.cpp",因为即使这个文件存在,它也没有出现在左侧的cpp文件夹中,我可以使用终端。下图告诉你我的意思 IMAGE

我需要帮助

这是 r18 之前的一些 NDK 二进制文件的问题:https://github.com/android-ndk/ndk/issues/574

不幸的是,

r18 在撰写本文时仍处于测试阶段,因此它还不能真正解决您的问题。您可以在您的系统上专门安装 ncurses 5,这应该可以解决问题,否则您最好的选择是暂时使用 docker 映像或基于 Ubuntu 的虚拟机。

请注意,一般来说,Android 工具的最佳兼容性将出现在 Ubuntu/Debian 上。我们会尽可能修复其他发行版的问题,但据我所知,它们没有经过积极测试。