本地OpenCV的样品为Android抛出的UnsatisfiedLinkError [英] Native OpenCV Samples for Android throws UnsatisfiedLinkError

查看:139
本文介绍了本地OpenCV的样品为Android抛出的UnsatisfiedLinkError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在模拟器中运行OpenCV的机器人样品。与本地code例如样品样本教程2高级 - 1.添加本机OpenCV的失败。我有一个Win7 x86的系统。我可以建立本机库,但我总是得到以下异常,如果我运行该示例:

I try to run the opencv android samples on the emulator. The samples with native code e.g. sample "Tutorial 2 Advanced - 1. Add Native OpenCV" fails. I have a Win7 x86 System. I can build the native libs but i always get the following exception if i run the sample:

 
10-04 08:08:19.179: WARN/dalvikvm(696): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/opencv/samples/tutorial3/Sample3View;
10-04 08:08:19.190: DEBUG/AndroidRuntime(696): Shutting down VM
10-04 08:08:19.190: WARN/dalvikvm(696): threadid=1: thread exiting with uncaught exception (group=0x40015560)
10-04 08:08:19.289: ERROR/AndroidRuntime(696): FATAL EXCEPTION: main
10-04 08:08:19.289: ERROR/AndroidRuntime(696): java.lang.ExceptionInInitializerError
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at org.opencv.samples.tutorial3.Sample3Native.onCreate(Sample3Native.java:23)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at android.os.Looper.loop(Looper.java:123)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at android.app.ActivityThread.main(ActivityThread.java:3683)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at java.lang.reflect.Method.invokeNative(Native Method)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at java.lang.reflect.Method.invoke(Method.java:507)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at dalvik.system.NativeStart.main(Native Method)
10-04 08:08:19.289: ERROR/AndroidRuntime(696): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load native_sample: findLibrary returned null
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at java.lang.Runtime.loadLibrary(Runtime.java:429)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at java.lang.System.loadLibrary(System.java:554)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     at org.opencv.samples.tutorial3.Sample3View.(Sample3View.java:27)
10-04 08:08:19.289: ERROR/AndroidRuntime(696):     ... 14 more
10-04 08:08:19.389: WARN/ActivityManager(70):   Force finishing activity org.opencv.samples.tutorial3/.Sample3Native
10-04 08:08:19.959: WARN/ActivityManager(70): Activity pause timeout for HistoryRecord{406f26a0 org.opencv.samples.tutorial3/.Sample3Native}
10-04 08:08:20.089: DEBUG/dalvikvm(70): GC_EXPLICIT freed 92K, 47% free 4404K/8263K, external 5449K/5830K, paused 103ms

任何想法,如何解决这个问题? 谢谢

Any ideas, how to fix this problem? Thanks

推荐答案

更​​改行

APP_ABI := armeabi-v7a

JNI / Application.mk

APP_ABI := armeabi

在默认情况下OpenCV的样本被配置为现代的ARMv7-A的硬件。

By default OpenCV samples are configured for modern armv7-a hardware.

这篇关于本地OpenCV的样品为Android抛出的UnsatisfiedLinkError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆