报错如下
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM
具体错误可看:https://blog.csdn.net/EatGrapes/article/details/86687819
解决链接:
https://blog.csdn.net/EatGrapes/article/details/86687819
https://stackoverflow.com/questions/54666491/ndk-build-error-for-ninja-cmake-make-program-is-not-set
https://stackoverflow.com/questions/54470140/android-studio-cmake-ninja-not-used-for-building-an-ndk-project/54473346#54473346
我的项目跟着上面链接解决还是没用。奇怪!~~
后来:按照阿拉伯数字顺序修改,就解决了
image.png
CMakeLists.txt代码如下:
cmake_minimum_required(VERSION 3.4.1)
find_library( log-lib
log )
#导入类库,只是作为引用,不编译
add_library( iBeaconLocation
SHARED
IMPORTED )
#引用目标类库是本地类库位置在libs/armeabi/xxx.so
set_target_properties( iBeaconLocation
PROPERTIES IMPORTED_LOCATION
src/main/cpp/${ANDROID_ABI}/libiBeaconLocation.so )
add_library( native-lib
SHARED
src/main/cpp/native-lib.cpp )
#引入头文件目录位置
include_directories(src/main/cpp/include/)
target_link_libraries( native-lib iBeaconLocation
${log-lib} )
网友评论