未设置忍者CMAKE_MAKE_PROGRAM的ndk构建错误 [英] ndk build error for Ninja CMAKE_MAKE_PROGRAM is not set

查看:1006
本文介绍了未设置忍者CMAKE_MAKE_PROGRAM的ndk构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载ndk cmake和LLDB进行ndk开发,然后用 c ++代码,应用程序编译错误.

I download ndk cmake and LLDB for ndk development.And then I create an project with c++ code,the application compiled error.

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.

...

Configuration failed.
External native generate JSON debug: JSON generation completed with problem
FAILURE: Build failed with an exception.

\* What went wrong:
Execution failed for task ':app:generateJsonModelDebug'.
com.android.ide.common.process.ProcessException: Error configuring

推荐答案

我解决了Valentin Safonnikov的评论:

I resolved the issue with Valentin Safonnikov's comment:

代替更改全局路径,您可以在与gradlew相同的目录中将cmake的路径添加到local.properties文件中.cmake.dir=D\:\\Android\\sdk\\cmake\\3.10.2.4988404"

我只认为它已解决.当我卸载cmake 3.10并仅保留cmake 3.6时,所有问题都终于解决了(即使使用cmake.dir=...\\3.6...,它仍然使用3.10.我可以在文本gradle输出中看到这一点:

I only thought it was solved. All issues were only finally solved when I uninstalled cmake 3.10 and left only cmake 3.6 installed (it kept using 3.10 even with cmake.dir=...\\3.6.... I could see this in the textual gradle output:

External native generate JSON debug: executing cmake Executable : C:\Users\User\AppData\Local\Android\Sdk\cmake\3.10.2.4988404\bin\cmake.exe
arguments : 
...
-DCMAKE_MAKE_PROGRAM=C:\Users\User\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe
...

这篇关于未设置忍者CMAKE_MAKE_PROGRAM的ndk构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆