I was trying to use opencv library, so I imported one of its projects in Android Studio and when I tried to run it I got this error:
Error:Execution faile
OpenCV sample projects haven't support gradle officially. I think it will be easier if you start a new project and configure it to work as in examples. I have implemented a tutorial project using Android Studio + NDK + OpenCV. You may have a look. https://github.com/quanhua92/NDK_OpenCV_AndroidStudio
Install NDK in your SDK manager, if you already installed open app's "build.gradle" replace these lines
sourceSets { main { jni.srcDirs = ['src/main/jni', 'src/main/jniLibs/', 'src/main/jni/'] } }
to
sourceSets.main {
jniLibs.srcDir 'src/main/jniLibs' // mention your JNI lib path(where ".so" files contains)
jni.srcDirs = [] //disable automatic ndk-build call
}
I'm tried to configure OpenCV and its fixed
You need to setup OpenCV librairies for your project. You can follow the instruction here.