user1899045
user1899045

Reputation: 41

Android Studio issue cmake

I have issue like this, when I want to rebuild my project.

Cause: executing external native build for cmake /home/hovsep/Documents/GITLAB/moon/Android/branches/Dev-Main/app/CMakeLists.txt

how can I fix it.

Upvotes: 3

Views: 1890

Answers (2)

Alexandr
Alexandr

Reputation: 1714

The error text you see is "top level". There may be anything behind it.

Need to look into log files like:

./app/.cxx/cmake/commonDebug/x86/android_gradle_generate_cmake_ninja_json_x86.stderr.txt

Do not know how to find all logs. I searched it in linux with:

find -mmin -1

That helped me to find the real issue in correspondent log files.

Upvotes: 2

VoltDragon
VoltDragon

Reputation: 1

This could be due to one of two problems.

  1. You also need to install ncurses5 as Android Studio doesn't support later versions, you may not have it or you may have a later version installed on your computer.

To reinstall ncurses5 open terminal in Ubuntu and type:

sudo apt install --reinstall libncurses5-dev

To install ncurses5 open terminal in Ubuntu and type :

sudo apt-get install libncurses5-dev

OR

  1. The problem is the wrong location of CMakelist.txt file.

Try to move CMakelist.txt file from your app root directory to app/src/main/cpp/CMakelist.txt directory and then update the location from gradle file also like this:

externalNativeBuild {
cmake {
    path "src/main/cpp/CMakeLists.txt"
      }
}

Otherwise IDK sorry.

Upvotes: 0

Related Questions