Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [Solved] The NDK root directory specified by CMAKE_ANDROID_NDK: /path/to/ndk  (Read 3339 times)

0 Members and 1 Guest are viewing this topic.

8Observer8

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • My website
    • Email
Hello,

I try to follow this guide: https://github.com/SFML/SFML/wiki/Tutorial%3A-Building-SFML-for-Android

But have a problem on the first step. I try to execute this command:

Quote
cmake -G "MinGW Makefiles" ../.. -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=/path/to/ndk -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug

Log:

Quote
E:\Libs\SFML-2.6.1\build\armeabi-v7a>cmake -G "MinGW Makefiles" ../.. -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=/path/to/ndk -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug
CMake Error at C:/Program Files/CMake/share/cmake-3.28/Modules/Platform/Android-Determine.cmake:141 (message):
  Android: The NDK root directory specified by CMAKE_ANDROID_NDK:

    /path/to/ndk

  does not exist.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.28/Modules/CMakeDetermineSystem.cmake:212 (include)
  CMakeLists.txt:38 (project)


CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

I created the CMAKE_ANDROID_NDK variable. I reopened CMD after adding.

« Last Edit: January 03, 2024, 12:35:03 pm by 8Observer8 »

8Observer8

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • My website
    • Email
I found my mistake. I must replace `/path/to/ndk` to "E:\AppData\Android\SDK\ndk\25.1.8937393" in the command:

Quote
cmake -G "MinGW Makefiles" ../.. -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK="E:/AppData/Android/SDK/ndk/25.1.8937393" -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug

But how to write this path in right way? I tried:

  • E:\AppData\Android\SDK\ndk\25.1.8937393
  • E:\\AppData\\Android\\SDK\\ndk\\25.1.8937393
  • E:/AppData/Android/SDK/ndk/25.1.8937393

Log:

Quote
E:\Libs\SFML-2.6.1\build\armeabi-v7a>cmake -G "MinGW Makefiles" ../.. -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK="E:/AppData/Android/SDK/ndk/25.1.8937393" -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug
CMake Error at build/armeabi-v7a/CMakeFiles/3.28.1/CMakeSystem.cmake:13 (set):
  Syntax error in cmake code at

    E:/Libs/SFML-2.6.1/build/armeabi-v7a/CMakeFiles/3.28.1/CMakeSystem.cmake:13

  when parsing string

    E:\AppData\Android\SDK\ndk\25.1.8937393

  Invalid character escape '\A'.
Call Stack (most recent call first):
  CMakeLists.txt:38 (project)


CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

8Observer8

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • My website
    • Email
The problem with path was solved. I should clean the build folder.

Quote
cmake -G "MinGW Makefiles" ../.. -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK="E:/AppData/Android/SDK/ndk/25.1.8937393" -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug

The next problem is: A problem occurred evaluating project ':app'
« Last Edit: January 03, 2024, 12:55:29 pm by 8Observer8 »