I am trying to port existing computer vision code, written in C++ using OpenCV, to Android NDK. I successfully imported the OpenCV library version 3.4.0 (using the official
Recently, NDK switched to libc++ as default STL, but OpenCV is built with gnustl.
externalNativeBuild {
cmake {
arguments "-DANDROID_STL=gnustl_shared"
}
}
for your library will fix that.
Alternatively, you can rebuild OpenCV with c++_shared.
Update: Good news! You can simply download OpenCV 4.0.1 and it will work smoothly with NDK r.18+.