Hyruu
Hyruu

Reputation: 95

Use Android Studio 2.2 CMake support with command line SDK

We recently decided to use Android Studio's CMake support as a part of our development, and as far as compiling and building is concerned everything works fine for the development team.

As a part of our validation efforts we are also running Jenkins for continuous testing, and that's where the problems are starting. The machine running Jenkins does not have Android Studio installed, nor it has an UI. As such it only possesses the android NDK and SDK. However, when running tests, the following error occurs :

Failed to find CMake.
    Install from Android Studio under File/Settings/Appearance & Behavior/System Settings/Android SDK/SDK Tools/CMake.
    Expected CMake executable at /home/vagrant/android-sdk-linux/cmake/bin/cmake.

The problem now is that there is no way to install CMake like suggested ! The machine does not have any UI to run Android Studio, and the command line tools feature no option to install CMake. And creating sym-links isn't the solution either, as CMake isn't the only thing it's looking for.

How am I supposed to make my project work on the machine ? CMake is running perfectly (as it was already used as part of the tests) so the problem is only coming from Gradle looking only in the SDK directory for it...

Upvotes: 1

Views: 780

Answers (2)

x90
x90

Reputation: 2170

The problem now is that there is no way to install CMake like suggested


Actually it is not! Instead of using android list sdk command for installing sdk packages you should use new command line tool: sdk-manager.
Ndk, cmake are available for installing through this new android sdk tool.

Upvotes: 2

J.chouki
J.chouki

Reputation: 26

you need to install manually cmake on your system unix:

go to your android sdk directory ${ANDROID_HOME} and create new cmake folder with:

  1. wget "https://dl.google.com/android/repository/cmake-3.6.3155560-linux-x86_64.zip"
  2. unzip -q cmake-3.6.3155560-linux-x86_64.zip -d ${ANDROID_HOME}/cmake
  3. add to PATH ENV ${PATH}:${ANDROID_HOME}/cmake/bin

Upvotes: 1

Related Questions