AndroidStudio上的JavaCV安装错误。无法找到* .so

时间:2015-07-01 22:12:34

标签: android javacv

我使用Android Studio开发Android应用程序。我已经使用Camera2 API构建了我的应用程序的相机部分,现在我想使用JavaCV处理图像(为了获取我正在进行的帧和ImageReader,但它给了我YUV_420_888帧,我甚至无法保存一个好的形状)。

所以我在这里关注了AndroidC的JavaCV manualy安装教程: https://github.com/bytedeco/javacv

当我写一些代码时,找到了库。 但是当我执行这个时:

        opencv_highgui.CvCapture capture = opencv_highgui.cvCreateCameraCapture(opencv_highgui.CV_CAP_ANDROID);

我得到了这个(警告,很多废话):

07-01 18:00:41.649    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r2.2.0.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r2.2.0.so"...
07-01 18:00:41.653    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r2.3.3.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r2.3.3.so"...
07-01 18:00:41.658    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r3.0.1.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r3.0.1.so"...
07-01 18:00:41.663    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.0.0.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r4.0.0.so"...
07-01 18:00:41.668    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.0.3.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r4.0.3.so"...
07-01 18:00:41.673    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.1.1.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r4.1.1.so"...
07-01 18:00:41.678    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.2.0.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r4.2.0.so"...
07-01 18:00:41.684    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.3.0.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android11BufferQueueC1EbRKNS_2spINS_19IGraphicBufferAllocEEE" referenced by "libnative_camera_r4.3.0.so"...
07-01 18:00:41.689    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.4.0.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android11BufferQueueC1ERKNS_2spINS_19IGraphicBufferAllocEEE" referenced by "libnative_camera_r4.4.0.so"...

最后:

  

CameraWrapperConnector :: connectToLib错误:无法dlopen相机包装库   Native_camera返回了打开错误:4

那么,我的libs是什么样的?

enter image description here

我没有碰到Gradle。为了使用这些jar,我添加了它们:Project Structure> app> dependecies>添加文件依赖项

我尝试了很多在互联网上流行的安装版本,最后我决定使用官方教程返回良好的基础。

像这样,我可以问你安装JavaCV的好方法是什么?我的意思是它终于可以找到那些错过的库吗?我在这上面花了很多时间,我还不太确定...... Ps:Sry因为我的英语不好而且我对你的所有问题持开放态度。

1 个答案:

答案 0 :(得分:0)

您可以使用gradle完全安装JavaCV。请看一下这个答案,你应该能够正确安装它。

https://stackoverflow.com/a/30130559/3990222

举个例子,尝试将以下行添加到您的gradle文件并删除.jar文件:

compile group: 'org.bytedeco', name: 'javacv', version: '0.11'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '2.4.11-0.11', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.6.1-0.11', classifier: 'android-arm'