java sdk 怎么打包,如何为Android Studio打包和链接OpenCV binares和OpenCV Java SDK?
尝试在Android Studio上开始使用OpenCV Java SDK创建一个针对14–19的应用程序.1)我在.jar中打包libs2)添加依赖项:????…????依赖{//OpenCVcompile files('libs/opencv-2.4.8.jar')compile project(':app:libs:opencv')}3)复制OpenCV java文件夹4)为Open...
尝试在Android Studio上开始使用OpenCV Java SDK创建一个针对14 – 19的应用程序.
1)我在.jar中打包libs
2)添加依赖项:
????…
????依赖{
//OpenCV
compile files('libs/opencv-2.4.8.jar')
compile project(':app:libs:opencv')
}
3)复制OpenCV java文件夹
4)为OpenCV创建并修复build.gradle(与引用的源相同)
5)尝试使用该库
import org.opencv.android.OpenCVLoader;
...
if (!OpenCVLoader.initDebug()) {}
结果:
????应用程序构建和运行,但我得到以下异常:
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ Trying to get library list
03-19 19:54:46.144 E/OpenCV/StaticHelper﹕ OpenCV error: Cannot load info library for OpenCV
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ Library list: ""
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ First attempt to load libs
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ Trying to init OpenCV libs
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ Trying to load library opencv_java
03-19 19:54:46.144 D/OpenCV/StaticHelper﹕ Cannot load library "opencv_java"
03-19 19:54:46.154 W/System.err java.lang.UnsatisfiedLinkError: Couldn't load opencv_java: findLibrary returned null
无法看到这里有什么问题.我尝试了每种可能的方法来打包.jar文件,并通过调整重复这些步骤至少10次.
我也试过结构:
-opencv.jar
-libs
-armeabi-v7a
-(.so files)
我正在测试三星GS3Mini和Genymotion 4.1.1,并在两者上获得相同的结果.两者都在运行OpenCV Manager和样本.
更多推荐
所有评论(0)