在导入一个新项目的时候出现了这个错,在此记录一下
先把错误LOG贴出来:
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
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
A problem occurred configuring project ':app'.
> executing external native build for cmake ****\app\CMakeLists.txt
引起错误的原因就是这个CMake,之前没接触过这个东西,遇到这总问题只能在网上疯狂寻找答案,出现类似的问题的人还是有那么多的,查到的答案有以下几种:
1.删除下载好的ndk cmake LLDB 在重新下载ndk cmake LLDB
2.更换NDK
3.环境没有搭好
4.将CMAKE_MAKE_PROGRAM项后面的路径设置为Qt安装路径下的路径如下所示:MinGW/bin/mingw32-make.exe,重新点击Configure,问题解决!
但是但是但是,我都试过了,还是没有解决我的问题!
在同事电脑上面跑得飞起,在我这就凉凉了,同事也没有找出问题,问题还是出现在环境配置上面,代码是肯定没问题的,于是奔着这条思路开始摸索
奔着这两条思路1.配置问题 2.CMake的原因 决定把CMake改为之前的老版本试试,结果OK了。
实现步骤
打开设置,将CMake换成低版本
这种没道理只能靠试的问题,希望能对大家有所帮助