I try to compile a shared library on Ubuntu using CMake for Android my "toolchain.cmake" file :
set (CMAKE_SYSTEM_NAME Android)
set (CMAKE_SYSTEM_VERSION 26)
set (CMAKE_ANDROID_ARCH_ABI armeabi-v7a)
set (CMAKE_ANDROID_NDK "/home/user/android-ndk-r23b")
set (CMAKE_ANDROID_STL_TYPE c _shared)
but I have this message error :
Android: The API specified by CMAKE_SYSTEM_VERSION='26' does not exist in the NDK. The directory: /home/user/android-ndk-r23b/platforms/android-26 does not exist.
Thanks
CodePudding user response:
According to your error message it seems that the path /home/user/android-ndk-r23b/platforms/android-26 does not exist. You can download the NDK from here https://developer.android.com/ndk/downloads and create and validate the path /home/user/android-ndk-r23b/platforms/android-26 from hand.
CodePudding user response:
It work using android-ndk-r17c
set (CMAKE_SYSTEM_NAME Android)
set (CMAKE_SYSTEM_VERSION 26)
set (CMAKE_ANDROID_ARCH_ABI armeabi-v7a)
set (CMAKE_ANDROID_NDK "/home/user/android-ndk-r17c")
set (CMAKE_ANDROID_STL_TYPE c _shared)
the folder "platforms" is missing in android-ndk-r23b
and I don't find arm-linux-androideabi-g
how to compile a shared library using CMake and android-ndk-r23b on Ubuntu ?