Debugging CMake issues

2,932 views
Skip to first unread message

Anton Gerasimov

unread,
Apr 23, 2018, 12:52:14 PM4/23/18
to android-ndk
Hi all,

I'm new to Android and am trying to compile a pre-existing library written a C++ as a native part of an Android application. The library uses CMake and is divided into small modules, so I decided as a first try to add one of these modules to the CMakeLists.txt generated by Android Studio (under "External Build Files" list) with add_subdirectory cmake command.
Unfortunately the error message I've got from Gradle was not really helpful. When I try to "Sync" the project, I get a single error in top-level task and the error is just "Extenal native build issues: Error configuring". Build gives and error in "Run build" -> "Calculate task graph" -> "Configure project: app" with "Cause: executing external native build for cmake". Both of these unfortunately give me no insight into what has failed. Is there a way to get the actual error log from Android Studio? Maybe the whole idea to use the Studio was wrong and there is a command line build system for Android (if yes, is the workflow documented somewhere)?

Thanks in advance.

Alex Cohn

unread,
Apr 24, 2018, 7:10:01 AM4/24/18
to android-ndk
Look at this stackoverflow answer: https://stackoverflow.com/a/43442227/192373

BR,
Alex

Anton Gerasimov

unread,
Apr 24, 2018, 11:56:54 AM4/24/18
to android-ndk
Sorry, stupid question, have launched gradle build from command line and got any info I need.
I'm still curious if I could get the build log directly from Android Studio though.

Alex Cohn

unread,
Apr 25, 2018, 3:40:15 AM4/25/18
to android-ndk
On Tuesday, April 24, 2018 at 6:56:54 PM UTC+3, Anton Gerasimov wrote:
Sorry, stupid question, have launched gradle build from command line and got any info I need.
I'm still curious if I could get the build log directly from Android Studio though.

This is exactly what i explain in the linked answer on SO. Is it hard to understand?
 

Anton Gerasimov

unread,
Apr 25, 2018, 1:08:13 PM4/25/18
to android-ndk
Hi Alex,

thank you for your help. My messages have to go through premoderation process, so there is a lag between writing a response an seeing it in the group. I've actually written my previous message before I could see yours.
Reply all
Reply to author
Forward
0 new messages