60

I'm building a substratum theme from https://github.com/substratum/template

I'm getting the following errors on run:

Build command failed.
Error while executing process /home/anubhav/Android/Sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/anubhav/AndroidStudioProjects/template/app/src/main/jni/Android.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-24 NDK_OUT=/home/anubhav/AndroidStudioProjects/template/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/anubhav/AndroidStudioProjects/template/app/build/intermediates/ndkBuild/debug/lib /home/anubhav/AndroidStudioProjects/template/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/libLoadingProcess.so}
[armeabi-v7a] Compile thumb  : LoadingProcess <= LoadingProcess.c
/home/anubhav/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
make: *** [/home/anubhav/AndroidStudioProjects/template/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/objs-debug/LoadingProcess/LoadingProcess.o] Error 127 

I'm running Android Studio 3.0.1 on Manjaro. I really don’t know what else info to provide, so please mention if anything is required.

Anubhav Das
  • 940
  • 1
  • 11
  • 16

3 Answers3

123

I had the same problem on Debian Buster. Installing the Debian package libncurses5 solved it for me:

$ sudo apt install libncurses5
Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
chkas
  • 1,328
  • 1
  • 7
  • 8
  • I got a similar problem for my Debian buster docker image. I solved it by installing `libncurses5-dev` and `libncursesw5-dev` – ismailsunni Oct 07 '19 at 15:13
  • non -dev for me, `The following NEW packages will be installed: libncurses5 libtinfo5{a} ` -4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux – Conor Nov 19 '19 at 22:50
  • 1
    Same problem on Ubuntu 19.10, solved by installing libncurses5 – Niclas Lindgren Dec 30 '19 at 08:08
  • 1
    For Fedora you need to install `ncurses-compat-libs` see https://github.com/spacchetti/spago/issues/104#issuecomment-563100691 – ismailsunni Jan 06 '20 at 19:37
  • I got similar problem when using kotlinc-native. Installing libncurses5 fixed it! Thanks! – Mohit Atray Jul 19 '20 at 10:47
  • Works for me on Ubuntu Linux. Had the same error when tried to run Tensilica C compiler `xt-clang`. – Danijel Nov 12 '20 at 13:09
  • in debian bullseye the same error may appear because libffi6 is not in the distribution (but libffi7 is) and thus the installation of the additioanl packages fails. – user855443 May 01 '21 at 09:58
  • This fixed the error, while making a WebGL project on Ubuntu 21.04. installing ncurses5 installed libtinfo5, which Unity 2020.3.7f1 (lts) needed to compile and build. – CherryCoke May 06 '21 at 17:59
  • worked on ubuntu 20-04. Setting a 'so.5' symbolic link to the existing libcurses did not work e.g sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so /usr/lib/libncurses.so.5. That library is not compatible with ndk r16b. Had to install the version-5 as per this answer. – drlolly Aug 19 '22 at 12:52
8

ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfo.so.5

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
  • Can you explain that a bit? Are these two versions binary compatible? Do they even do the same thing? Why not rather install the required dependencies instead? See also [answer]. – Robert Feb 22 '20 at 23:38
  • Honestly, laziness to search for the required library. Since both have the required internal procedures, it won't matter for the calling library. – Samir Al-Shaar Feb 24 '20 at 04:46
  • 1
    `ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/libtinfo.so.5` in my case, but yeah this worked and fixed pytorch for me. Normally I don't like this type of answer, but what can I say.... have an upvote. – Z4-tier May 06 '21 at 01:43
  • Brilliant idea, this worked for me on Fedora! In my case it was `ln -s /usr/lib64/libtinfo.so.6 /usr/lib64/libtinfo.so.5` and it was for an old precompiled version of `include-what-you-use`. – Gavin Ray Nov 22 '22 at 03:35
1

libtinfo is not an Android API. You need to build that library for Android and include it in your APK.

Dan Albert
  • 10,079
  • 2
  • 36
  • 79