fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Fresco and OpenCV

Open leicht-io opened this issue 11 years ago • 2 comments

Hello,

I am having some techinical issues with Fresco and OpenCV. I am compiling OpenCV from source using the Android NDK, and after including Fresco i get the following exception: Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/xxx-1/base.apk"],nativeLibraryDirectories=[/data/app/xxx-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libopencv_java.so"

It seems that, somehow with Fresco included, the libopencv_java.so doesn't get included in my application. After removing the Fresco library it seems to work as intended.

In my build.gradle i am compiling OpenCV with the following task:

sourceSets.main.jni.srcDirs = []
task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
    commandLine "path to ndk-build.cmd",
            'NDK_PROJECT_PATH=build/intermediates/ndk',
            'NDK_LIBS_OUT=src/main/jniLibs',
            'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
            'NDK_APPLICATION_MK=src/main/jni/Application.mk'
}

tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn ndkBuild
}

I do not know what's creating this error, but I hope you can help me. Thank you - Christian.

leicht-io avatar Mar 27 '15 09:03 leicht-io

Have you tried to verify whether all *.so files are included in the final apk ? This might help establish what is going on.

To check that just unzip your apk and examine content of 'lib' directory

michalgr avatar Mar 27 '15 17:03 michalgr

Closing this as we haven't heard back. Please reopen if this is still an issue.

plamenko avatar Apr 17 '15 00:04 plamenko