Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Android Studio failes to find CMake

1) I get this error:

Failed to find CMake.

Gradle sync failed: Failed to find CMake. Install from Android Studio under File/Settings/Appearance & Behavior/System Settings/Android SDK/SDK Tools/CMake. Expected CMake executable at /Users/myUser/Library/Android/sdk/cmake/bin/cmake. Consult IDE log for more details (Help | Show Log)

2) I go to SDK manager, there is no cmake to select to download.

3) I download manually SDK from here: https://cmake.org/download/

4) I put it in the necessary folder, as my android studio suggested.

5) I get this error:

Build command failed. Error while executing 'C:\Users\TP\AppData\Local\Android\Sdk\cmake\bin\cmake.exe' with arguments {-HC:\Users\TP\AndroidStudioProjects\FunFacts\app -BC:\Users\TP\AndroidStudioProjects\FunFacts\app.externalNativeBuild\cmake\release\armeabi -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi -DANDROID_NDK=C:\Users\TP\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\TP\AndroidStudioProjects\FunFacts\app\build\intermediates\cmake\release\obj\armeabi -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=C:\Users\TP\AppData\Local\Android\Sdk\cmake\bin\ninja.exe -DCMAKE_TOOLCHAIN_FILE=C:\Users\TP\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=15 -DCMAKE_CXX_FLAGS=} CMake Error: Could not create named generator Android Gradle - Ninja Generators

1 Answer

I guess going to SDK Manager (down arrow icon on the upper main menu) -> System Settings -> Android Sdk -> On the Tabs choose "SDK Tools" -> Find checkitem with caption "Cmake". check it and press "Install" - can help

Thank you for this. Solved the same issue I was experiencing after hours of trying to solve it