android build.ninja,【Android】记一次Ninja引发的血案

【Android】记一次Ninja引发的血案

报错日志

报错原因

解决引导

解决方案

完整报错log

报错日志

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.

报错原因

使用了armeabi-v7a,导致cmake编译时找不到Ninja

解决引导

查看Android Studio的sdk目录

8a85ca9e5a7ef391cd4e35f9d7c3753f.png

进入终端依次查看:

我们发现使用ninja这个东西的,但是在终端输入ninja却找不到该命令

原因是没有设置ninja的环境变量

解决方案

配置ninja环境变量

vim ~/.bash_profile

0a9e3e8a26e0ecb8b6547748cba33534.png

ANDROID_HOME=你的sdk路径

source ~/.bash_profile

重启终端,编译./gradlew assembleDebug

搞定!!!

完整报错log

[== “CMake Server” ==[

{“supportedProtocolVersions”:[{“isExperimental”:true,“major”:1,“minor”:1}],“type”:“hello”}

]== “CMake Server” ==]

[== “CMake Server” ==[

{

“type”: “handshake”,

“cookie”: “gradle-cmake-cookie”,

“protocolVersion”: {

“isExperimental”: true,

“major”: 1,

“minor”: 1

},

“sourceDirectory”: “D:/EagleEye2.0/app”,

“buildDirectory”: “D:/EagleEye2.0/app/.externalNativeBuild/cmake/debug/armeabi-v7a”,

“generator”: “Ninja”

}

]== “CMake Server” ==]

[== “CMake Server” ==[

{“cookie”:“gradle-cmake-cookie”,“inReplyTo”:“handshake”,“type”:“reply”}

]== “CMake Server” ==]

[== “CMake Server” ==[

{

“type”: “configure”,

“cacheArguments”: [

“”,

“-DANDROID_ABI\u003darmeabi-v7a”,

“-DANDROID_PLATFORM\u003dandroid-19”,

“-DCMAKE_LIBRARY_OUTPUT_DIRECTORY\u003dD:\EagleEye2.0\app\build\intermediates\cmake\debug\obj\armeabi-v7a”,

“-DCMAKE_BUILD_TYPE\u003dDebug”,

“-DANDROID_NDK\u003dD:\Androidsdk\android-ndk-r14b”,

“-DCMAKE_CXX_FLAGS\u003d-std\u003dc++11 -frtti -fexceptions”,

“-DCMAKE_SYSTEM_NAME\u003dAndroid”,

“-DCMAKE_ANDROID_ARCH_ABI\u003darmeabi-v7a”,

“-DCMAKE_SYSTEM_VERSION\u003d19”,

“-DCMAKE_EXPORT_COMPILE_COMMANDS\u003dON”,

“-DCMAKE_ANDROID_NDK\u003dD:\Androidsdk\android-ndk-r14b”,

“-DCMAKE_TOOLCHAIN_FILE\u003dD:\EagleEye2.0\app\.externalNativeBuild\cmake\debug\armeabi-v7a\pre-ndk-r15-wrapper-android.toolchain.cmake”,

“-G Ninja”,

“-DANDROID_ARM_NEON\u003dTRUE”,

“-DANDROID_TOOLCHAIN\u003dclang”,

“-DCMAKE_BUILD_TYPE\u003dRelease”,

“-DANDROID_TOOLCHAIN\u003dclang”,

“-DANDROID_STL\u003dgnustl_static”

]

}

]== “CMake Server” ==]

[== “CMake Server” ==[

{“cookie”:"",“inReplyTo”:“configure”,“message”:“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.”,“title”:“Error”,“type”:“message”}

]== “CMake Server” ==]

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 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 Server” ==[

{“cookie”:"",“inReplyTo”:“configure”,“progressCurrent”:1000,“progressMaximum”:1000,“progressMessage”:“Configuring”,“progressMinimum”:0,“type”:“progress”}

]== “CMake Server” ==]

[== “CMake Server” ==[

{“cookie”:"",“inReplyTo”:“configure”,“message”:“Configuring incomplete, errors occurred!\nSee also “D:/EagleEye2.0/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log”.”,“type”:“message”}

]== “CMake Server” ==]

Configuring incomplete, errors occurred!

See also “D:/EagleEye2.0/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log”.

Configuring incomplete, errors occurred!

See also “D:/EagleEye2.0/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log”.

[== “CMake Server” ==[

{“cookie”:"",“errorMessage”:“Configuration failed.”,“inReplyTo”:“configure”,“type”:“error”}

]== “CMake Server” ==]

Configuration failed.

External native generate JSON debug: JSON generation completed with problems

FAILURE: Build failed with an exception.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值