# How to install cmake using Android sdkmanager?

**URL:** <https://discuss.bitrise.io/t/how-to-install-cmake-using-android-sdkmanager/876>\
**Category:** Android\
**Tags:** android, android-ndk\
**Created:** [February 21, 2017, 12:59pm UTC](https://discuss.bitrise.io/t/how-to-install-cmake-using-android-sdkmanager/876 "2017-02-21T12:59:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 21, 2017, 12:59pm UTC](https://discuss.bitrise.io/t/how-to-install-cmake-using-android-sdkmanager/876/1 "2017-02-21T12:59:25Z")

</div>

You can do this with a simple **Script** step:

(source: [Remove pre-installed CMake by viktorbenei · Pull Request #38 · bitrise-io/android-ndk · GitHub](https://github.com/bitrise-docker/android-ndk/pull/38#issuecomment-281309983) )

```auto
#!/bin/bash
set -ex
mkdir -p "${ANDROID_HOME}/licenses"
echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > "${ANDROID_HOME}/licenses/android-sdk-license"
"${ANDROID_HOME}/tools/bin/sdkmanager" --list | grep cmake | tail -n 1 | cut -d \| -f 1 | xargs "${ANDROID_HOME}/tools/bin/sdkmanager"

```

**Note:** `gradlew` can install `cmake` automatically, you don’t need this script if you build your Android NDK project with `gradle(w)`!

All you have to do in that case is providing the license (e.g. with:

```auto
mkdir -p "${ANDROID_HOME}/licenses"
echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > "${ANDROID_HOME}/licenses/android-sdk-license"

```

if you use `CMake 3.6.3155560`, or just copy your own license as described at [http://devcenter.bitrise.io/android/frequent-android-issues/#alternative-solution-for-the-license-error](http://devcenter.bitrise.io/android/frequent-android-issues/#alternative-solution-for-the-license-error)) for the android ndk cmake.

Related discussion: [[Android-Build NDK] CMake license problem · Issue #33 · bitrise-io/build.issues · GitHub](https://github.com/bitrise-io/build.issues/issues/33)

---

<div class="post-metadata">

**Author:** ![rajivshah3](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/rajivshah3/32/1996_2.png) [@rajivshah3](https://discuss.bitrise.io/u/rajivshah3)\
**Post date:** [January 21, 2019, 6:15pm UTC](https://discuss.bitrise.io/t/how-to-install-cmake-using-android-sdkmanager/876/3 "2019-01-21T18:15:48Z")

</div>

For anyone having problems with `CMake 3.6.4111459`, use `24333f8a63b6825ea9c5514f83c2829b004d1fee` as the license key instead of `8933...`

---

<div class="post-metadata">

**Author:** ![sufyan](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@sufyan](https://discuss.bitrise.io/u/sufyan)\
**Post date:** [March 14, 2023, 9:12am UTC](https://discuss.bitrise.io/t/how-to-install-cmake-using-android-sdkmanager/876/4 "2023-03-14T09:12:21Z")

</div>

where do i add this step i recently got error on the android build step it was working up til now

**What went wrong:**  
**Could not determine the dependencies of task ‘:react-native-reanimated:mergeReleaseNativeLibs’.**  
**\> CMake ‘3.6.0’ was not found in PATH or by cmake.dir property.**  
\*\* - CMake ‘3.22.1’ found in SDK did not match requested version ‘3.6.0’.\*\*  
\*\* - CMake ‘3.25.3’ found in PATH did not match requested version ‘3.6.0’.\*\*

---

<div class="post-metadata">

**Author:** ![shan\_shaji](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@shan\_shaji](https://discuss.bitrise.io/u/shan_shaji)\
**Post date:** [April 5, 2023, 1:04pm UTC](https://discuss.bitrise.io/t/how-to-install-cmake-using-android-sdkmanager/876/5 "2023-04-05T13:04:03Z")

</div>

I am also having the same problem @sufyan Where you able to fix it?
