Android Studio 2.3.3 32位 win7 cmake的配置


在Android Studio中,CMake是可以直接通过SDK Manager下载的,但是在Android Studio 32位里就只能自己下载了。我从CMake官网获取了一份最新的CMake,放到报错提示的位置下,遇到了错误:
CMake Error: Could not create named generator Android Gradle - Ninja
通过查找资料,确定了Android使用的CMake必须是Google提供的,因此通过腾讯的Bugly镜像获取到了Android需要使用的CMake,下载地址:
http://a62f762da201.repository.bugly.qq.com/android/repository/cmake-3.6.3155560-windows-x86_64.zip

解压后发现多了ninja.exe文件,所以需要编译32位的。下载ninja 源代码:

https://github.com/ninja-build/ninja/releases


vs编译ninja 如下:

Building on Windows

First of all cygwin builds are NOT supported and will not be supported by android-cmake. To build natively on Windows you need a port of make but I recommend http://martine.github.io/ninja/ instead.(网址打不开了)

To build with Ninja you need:
Ensure you are using CMake newer than 2.8.9;
Download the latest Ninja from https://github.com/martine/ninja/releases;
Put the ninja.exe into your PATH (or add path to ninja.exe to your PATH environment variable);
Pass -GNinja to cmake alongside with other arguments (or choose Ninja generator in cmake-gui).
Enjoy the fast native multithreaded build :)

根据编译介绍,需要安装python2.7,vs命令行中编译


将ninja.exe拷贝到cmake\bin目录下。将bin目录添加到变量中。在cmd中输入ninja --version,查看是否安装正确。


32位的android studio  使用cmake的问题还是没有解决,编译参数cmake -GAndroid Gradle - Ninja  还是报错,如果有解决问题的能否告知我呢,谢谢。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章