java Android - OpenCV 错误:无法加载 OpenCV 的信息库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37180378/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android - OpenCV error: Cannot load info library for OpenCV
提问by Mohammad Nurdin
I already setup OpenCV SDK in Android Studio (https://www.learn2crack.com/2016/03/setup-opencv-sdk-android-studio.html) but it seems I got this kind of error message.
我已经在 Android Studio ( https://www.learn2crack.com/2016/03/setup-opencv-sdk-android-studio.html) 中设置了 OpenCV SDK,但似乎我收到了这种错误消息。
05-12 03:30:08.819 5480-5480/my.xxxxx I/art: Late-enabling -Xcheck:jni
05-12 03:30:08.925 5480-5480/my.xxxxx D/OpenCV/StaticHelper: Trying to get library list
05-12 03:30:08.926 5480-5480/my.xxxxx E/OpenCV/StaticHelper: OpenCV error: Cannot load info library for OpenCV
05-12 03:30:08.926 5480-5480/my.xxxxx D/OpenCV/StaticHelper: Library list: ""
05-12 03:30:08.926 5480-5480/my.xxxxx D/OpenCV/StaticHelper: First attempt to load libs
05-12 03:30:08.926 5480-5480/my.xxxxx D/OpenCV/StaticHelper: Trying to init OpenCV libs
05-12 03:30:08.926 5480-5480/my.xxxxx D/OpenCV/StaticHelper: Trying to load library opencv_java3
05-12 03:30:08.926 5480-5480/my.xxxxx D/OpenCV/StaticHelper: Cannot load library "opencv_java3"
I already include opencv_java3
into JNI
folder.
我已经包含opencv_java3
到JNI
文件夹中。
回答by Grubsy
Most online tutorial will tell you to add just armeabi-v7a
and x86_64
into your jniLibs
folder, but this can cause errors in recent versions of OpenCV. The following briefly describes a few tweaks I used to fix this error when I was experiencing the same issue.
大多数在线教程会告诉您只将armeabi-v7a
和添加x86_64
到您的jniLibs
文件夹中,但这可能会导致最新版本的 OpenCV 出现错误。下面简要描述了我在遇到相同问题时用来修复此错误的一些调整。
Solution 1:
解决方案1:
Make sure the JNI folder you are placing the OpenCV libraries in is named jniLibs
确保您将放置 OpenCV 库的 JNI 文件夹命名为 jniLibs
Solution 2:
解决方案2:
Copy ALLthe directories found in OpenCV-android-skd/sdk/native/libs
to your jniLibs
folder.
将找到的所有目录复制OpenCV-android-skd/sdk/native/libs
到您的jniLibs
文件夹中。
jniLibs folder with all OpenCV libraries added
Recommended:
受到推崇的:
Even though it is a separate issue involving the emulator, you should also add the code snippet posted by FD3in your app Module Gradle file. This will prevent the INSTALL_FAILED_NO_MATCHING_ABISerror from occuring after attempting to run your app on an emulator.
即使它是一个涉及模拟器的单独问题,您也应该在您的应用程序模块 Gradle 文件中添加FD3发布的代码片段。这将防止在尝试在模拟器上运行您的应用程序后发生INSTALL_FAILED_NO_MATCHING_ABIS错误。
回答by Icehour
回答by Manish
If someone is still (March 2020) searching for this error -
如果有人仍在(2020 年 3 月)搜索此错误 -
E/OpenCV/StaticHelper: OpenCV error: Cannot load info library for OpenCV
and ends up here on this StackOverflow discussion, here is a helpful clarification from the OpenCV contributor on their site itself.
并在此 StackOverflow 讨论中结束,这里是 OpenCV 贡献者在其网站上的有用说明。
Ignore this error message. "Info library" is used for special Android configurations, like builds with CUDA support.
忽略此错误消息。 “信息库”用于特殊的 Android 配置,例如支持 CUDA 的构建。
Please see this (currently open) issue here - https://github.com/opencv/opencv/issues/15567
请在此处查看此(当前打开的)问题 - https://github.com/opencv/opencv/issues/15567
回答by FD3
Over a year later but I found this to work for me. In you app Module gradle file, add:
一年多后,但我发现这对我有用。在你的 app 模块 gradle 文件中,添加:
splits {
abi {
enable true
reset()
include 'x86', 'armeabi-v7a', 'x86_64'
universalApk true
}
}
This should be put in with the android brackets. Obviously adjust your includes for which ever you may need.
这应该放在android括号中。显然,根据您的需要调整您的包含。