Trying to get started with OpenCV Java SDK on Android Studio creating an app targetting 14 - 19.
I'm following steps defined by @Paito here: https://stackoverflow.com/a/20600674/1291489
1) I package libs in a .jar
2) Add dependencies: ... dependencies {
//OpenCV
compile files('libs/opencv-2.4.8.jar')
compile project(':app:libs:opencv')
}
3) Copy the OpenCV java folder
4) Create and fix build.gradle for OpenCV (same as referenced source)
5) Try to use the library
import org.opencv.android.OpenCVLoader;
...
if (!OpenCVLoader.initDebug()) {}
Results: App builds and runs but I get the following exception:
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ Trying to get library list
03-19 19:54:46.144 E/OpenCV/StaticHelper﹕ OpenCV error: Cannot load info library for OpenCV
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ Library list: ""
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ First attempt to load libs
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ Trying to init OpenCV libs
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ Trying to load library opencv_java
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ Cannot load library "opencv_java"
03-19 19:54:46.154 W/System.err java.lang.UnsatisfiedLinkError: Couldn't load opencv_java: findLibrary returned null
Not able to see what's wrong here. I tried every possible way of packaging the .jar file and repeated the steps at least 10 times with tweaks.
I also tried structure:
-opencv.jar
-libs
-armeabi-v7a
-(.so files)
I am testing on a Samsung GS3Mini and Genymotion 4.1.1, and getting same results on both. Both are running OpenCV Manager and samples.