0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CmakeのAndroid用ビルドでNDKが見つからないと言われる時

Posted at

状況

CmakeでAndroid用のビルドが必要なためAndroid StudioからNDKをインストールしたがNDKが見つからないと言われる。

エラー内容

CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/Platform/Android-Determine.cmake:217 (message):
  Android: Neither the NDK or a standalone toolchain was found.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeDetermineSystem.cmake:184 (include)
  CMakeLists.txt:3 (project)


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

解決方法

環境変数に以下を追加
変数名

ANDROID_NDK

Path

C:\Users\<YourUser>\AppData\Local\Android\Sdk\ndk\{ndk-version}

所感

環境変数の書かれ方が何パターンかあるため使用するソフトでどれが優先されているか分からない。
Ninjaもないと言われてるが今回はNDKが通ってないために出ているだけで実際は問題なかった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?