- Follow this gist to build OpenCV shared library for Android.
- Create a new project, Java, MinSDK API26.
- In
Project Side Bar
, right click onApp
and selectNew -> Folder -> JNI Folder
. - Check the
Change Folder Location
check box and rename the last part of the path fromsrc/main/jni/
tosrc/main/jniLibs/
. - Go to your
OpenCV/01_ndk_outputs/sdk/native/libs
source directory and select all the folders and copy them intojniLibs
of your Android Studio project. - It is assumed that your phone is a
arm64-v8a
. - Open your app's
build.gradle
and add this todefaultConfig
entry:
externalNativeBuild{
cmake{