UnsatisfiedLinkError for libopencv_core.so while .apk holds this library

别等时光非礼了梦想. 提交于 2019-12-06 13:43:08

问题


I want to use JavaCv with my App on Android. Therefore I followed the advice here: https://github.com/bytedeco/javacv on how to install Android 2.2 or newer. As a result the following libraries can be found under \libs\armeabi: libjniopencv_core.so libopencv_core.so

All classes of both libraries are also present in the classes.dex file of my .apk. And still i get the following exception:

java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libopencv_core.so" needed by "libjniopencv_core.so"; caused by load_library(linker.cpp:745): library "libopencv_core.so" not found

I tried loading libopencv_core.so via

System.loadLibrary("libopencv_core")

and

System.loadLibrary("opencv_core")

with the same outcome..

Any hint on how to solve this issue would be appreciated.

Edit1:

I had a look to see which .so files could actually be found under /data/app-lib/ccc.android.myappname...

Despite libopencv_core.so and other files can be found under lib/armeabi/ in my .apk only some of them are available for my activity under /data/app-lib/ccc.android.myappname. The others are just ignored for some unknown reason.

Can somebody help, i have no idea what is going on.

Thank you.


回答1:


Here the solution i found:

I discussed this matter on the JavaCv board on Github:

https://github.com/bytedeco/javacv/issues/28

The Issue might be history with the next release, but for the meantime do as follows:

Before using JavaCv for the first time run:

static {
        System.loadLibrary("tbb");
        System.loadLibrary("opencv_core");
        System.loadLibrary("jniopencv_core");
}

On some devices (or occasion) the intended load order get mixed up...



来源:https://stackoverflow.com/questions/24882310/unsatisfiedlinkerror-for-libopencv-core-so-while-apk-holds-this-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!