简体   繁体   English

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

[英]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. 我遵循了此页面https://developer.android.com/ndk/guides/来安装入门所需的内容。 So I open new project as I do normally with checking c/c++ and blank example. 因此,我像检查C / C ++和空白示例一样正常地打开新项目。 when android studio open the main window, it can't build the default program by giving this error : External Native Build issues (2 errors). 当android studio打开主窗口时,它无法通过给出以下错误来构建默认程序:外部本机构建问题(2个错误)。

this is the contents of the file CMakeOutput.log : 这是文件CMakeOutput.log的内容:

The target system is: Android - 1 - armv7-a The host system is: Linux - 4.17.6-1-ARCH - x86_64 目标系统是:Android-1-armv7-a主机系统是:Linux-4.17.6-1-ARCH-x86_64

and this is the contents of the file CMakeError.log : 这是文件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 确定C编译器是否工作失败,并显示以下输出:更改目录:/home/abdelillah/AndroidStudioProjects/test/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp运行构建命令:“ / home / abdelillah / Android / Sdk / cmake / 3.6.4111459 / bin / ninja“” cmTC_dd920“ [1/2]构建C对象CMakeFiles / cmTC_dd920.dir / testCCompiler.co失败:/ 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 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:加载共享库时出错:libtinfo.so.5:无法打开共享对象文件:无此类文件或目录忍者:生成停止:子命令失败

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. 其他事情,我不能直接在主窗口中编辑“ native-lib.cpp”,因为即使该文件存在,它也不会出现在左侧的cpp文件夹中,我可以使用终端查看它。 the following image show you what I mean IMAGE 下图显示了我的意思IMAGE

I need help 我需要帮助

This was an issue with some NDK binaries before r18: https://github.com/android-ndk/ndk/issues/574 这是r18之前的某些NDK二进制文件的问题: 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. 不幸的是,在撰写本文时,r18仍处于beta版,因此它还不能真正解决您的问题。 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. 您也许可以在系统上专门安装ncurses 5,这应该可以解决问题,否则,最好的选择是暂时使用docker映像或基于Ubuntu的VM。

Note that, in general, best compatibility for Android tools is going to be on Ubuntu/Debian. 请注意,通常,Android工具的最佳兼容性将是在Ubuntu / Debian上。 We fix issues for other distros when we can, but they are not actively tested to my knowledge. 我们会尽力为其他发行版解决问题,但据我所知,它们还没有得到积极测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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