简体   繁体   English

Android中OpenCV的JavaCpp预设。 示例抛出UnsatisfiedLinkError

[英]JavaCpp presets for OpenCV in Android. Example throws UnsatisfiedLinkError

I am trying to run the Android samples of bytedeco but I constantly get a 我正在尝试运行bytedeco的Android示例,但是我不断得到

org.bytedeco.javacv.android.recognize.example E/art: dlopen("/data/app/org.bytedeco.javacv.android.recognize.example-2/lib/arm/libjniopencv_core.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN2cv8internal18WriteStructContextD1Ev" referenced by "libniopencv_core.so"...

This is happening in this line 这行正在发生

opencv_face.FaceRecognizer faceRecognizer = createEigenFaceRecognizer(); in the OpenCvRecognizeActivity class OpenCvRecognizeActivity类中

I get the error with any other OpenCV related class I try to use of opencv_core 我尝试使用opencv_core任何其他OpenCV相关类都收到错误

I have not changed the dependencies in the sample app. 我没有在示例应用程序中更改依赖项。 They look like this: 他们看起来像这样:

compile group: 'org.bytedeco', name: 'javacv', version: '1.3.2'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.2.0-1.3', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.2.0-1.3', classifier: 'android-x86'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3', classifier: 'android-x86'

Am I missing something? 我想念什么吗? Does the setup of the app require some previous steps? 应用程序的设置是否需要一些先前的步骤?

Thanks 谢谢

Not 100% sure yet but it looks the problem is either the Android version (I was working with a 5.0 device) or the device itself. 尚不确定100%,但看起来问题出在Android版本(我正在使用5.0设备)还是设备本身。 I've just installed the demo app in a new phone and it does work 我刚刚在新手机上安装了演示应用,它确实可以正常工作

Make sure your application contains all the required .so files. 确保您的应用程序包含所有必需的.so文件。 You can check it using Android studio, just click on the .apk file and it will show you .apk file contents. 您可以使用Android Studio对其进行检查,只需单击.apk文件,它将显示.apk文件内容。 If it's not having opencv .so files then manually copy those .so files inside "lib" folder in your project and provide it's dependencies in .gradle file. 如果没有opencv .so文件,则手动将这些.so文件复制到项目的“ lib”文件夹中,并在.gradle文件中提供其依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM