gpt4 book ai didi

android-studio - 未设置 Ninja CMAKE_MAKE_PROGRAM 的 ndk 构建错误

转载 作者:行者123 更新时间:2023-12-04 06:33:44 25 4
gpt4 key购买 nike

我下载了 ndk cmake 和 LLDB 用于 ndk 开发。然后我创建了一个项目
c++代码,应用程序编译出错。

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 的评论解决了这个问题:

"Instead changing global path, you can add the path to cmake into local.properties file in the same dir as gradlew. cmake.dir=D\:\\Android\\sdk\\cmake\\3.10.2.4988404"



编辑:我只认为它已解决。当我卸载 cmake 3.10 并只安装 cmake 3.6 时,所有问题才最终得到解决(即使使用 cmake.dir=...\\3.6...,它仍然使用 3.10。我可以在文本 gradle 输出中看到这一点:
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
...

关于android-studio - 未设置 Ninja CMAKE_MAKE_PROGRAM 的 ndk 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54666491/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com