External Native Build Issues Android Studio NDK Sample HelloJni (Build Failed)

29,954

Solution 1

open Terminal and run this command:

gradlew build --stacktrace

enter image description here

Solution 2

If you run under Linux you need to install Ninja. sudo apt install ninja-build

Tested today.

Solution 3

you have to install ninja using homebrew

brew install ninja

Solution 4

You also need to install ncurses5 (for arch-linux its AUR package - ncurses5-compat-libs), since NDK support on Android Studio 2.2 doesn't use ncurses6 which might be installed on your system.

Solution 5

I solved my problem with examining log files.

./app/.cxx/cmake/commonDebug/x86/android_gradle_generate_cmake_ninja_json_x86.stderr.txt
Share:
29,954
Gunjan Dave
Author by

Gunjan Dave

Updated on July 23, 2022

Comments

  • Gunjan Dave
    Gunjan Dave almost 2 years

    Error: executing external native build for cmake C:\Users\PC1\Desktop\ndkdata\GDNdkText\app\CMakeLists.txt

    Error While Building:

    Error Image

    I have installed NDK, CMake, LLDP as mentioned here. Do I need to install any other tool or need to set any environment variables?

  • Neha Sharma
    Neha Sharma over 5 years
    Its gradlew build --stacktrace
  • Sergio
    Sergio about 5 years
    It works on MacOs. Homebrew may ask to change the ownership of some directories, in my case I used the command sudo chown -R user_name /usr/local/lib/pkgconfig, where user_name is the name of the current user. And after that the command brew install ninja did the trick.