Unable to find mixed_sample.so

2019-08-26 07:51发布

问题:

I'm trying to build tutorial-2-mixedprocess application (in android-studio) that came with the opencv-SDK 3.2.0. But my application crashes because of a missing mixed_sample library

// Load native library after(!) OpenCV initialization
System.loadLibrary("opencv_java3");     //This one is taken care in CmakeLists.txt
Log.d(TAG, "Loaded the opencv");        //This line appears on the monitor                        
System.loadLibrary("mixed_sample");   // C-R-A-S-H h h h

I looked inside OpenCV-android-sdk/sdk/native/libs directory that came with opencv-3.2.0-android-sdk.zip but *mixed_sample.so is nowhere to be found.

Where to find this file?

EDIT
The full error says following:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.opencv.samples.tutorial2-1/base.apk"],nativeLibraryDirectories=[/data/app/org.opencv.samples.tutorial2-1/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libmixed_sample.so"

回答1:

In Android Studio do the following

  1. Create Folder "jniLibs" inside "src/main/"
  2. Put all your .so libraries inside "src/main/jniLibs" folder
  3. just sync gradle again and project. Run your application.

make sure you have put java and jnilibs at proper places.

can you share tree structure of project screenshot?