Ask Your Question
0

cannot load info library for opencv

asked 2013-02-18 04:14:56 -0600

yamen ajjour gravatar image

updated 2013-02-18 04:18:29 -0600

after getting openv for android from git and compiling it , i tried to run the 3rd tutorial , the problem is i am getting opencv drror : cannot load info library for opencv

02-18 12:04:26.959: W/System.err(9329): java.lang.UnsatisfiedLinkError: Couldn't load opencv_java: findLibrary returned null 02-18 12:04:26.959: W/System.err(9329): at java.lang.Runtime.loadLibrary(Runtime.java:365) 02-18 12:04:26.959: W/System.err(9329): at java.lang.System.loadLibrary(System.java:535) 02-18 12:04:26.959: W/System.err(9329): at org.opencv.android.StaticHelper.loadLibrary(StaticHelper.java:54) 02-18 12:04:26.959: W/System.err(9329): at org.opencv.android.StaticHelper.initOpenCVLibs(StaticHelper.java:85) 02-18 12:04:26.964: W/System.err(9329): at org.opencv.android.StaticHelper.initOpenCV(StaticHelper.java:29) 02-18 12:04:26.964: W/System.err(9329): at org.opencv.android.OpenCVLoader.initDebug(OpenCVLoader.java:26) 02-18 12:04:26.964: W/System.err(9329): at org.opencv.samples.tutorial3.Sample3Native.<clinit>(Sample3Native.java:27) 02-18 12:04:26.964: W/System.err(9329): at java.lang.Class.newInstanceImpl(Native Method) 02-18 12:04:26.964: W/System.err(9329): at java.lang.Class.newInstance(Class.java:1319) 02-18 12:04:26.964: W/System.err(9329): at android.app.Instrumentation.newActivity(Instrumentation.java:1068) 02-18 12:04:26.964: W/System.err(9329): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2015) 02-18 12:04:26.964: W/System.err(9329): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125) 02-18 12:04:26.964: W/System.err(9329): at android.app.ActivityThread.access$600(ActivityThread.java:140) 02-18 12:04:26.964: W/System.err(9329): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227) 02-18 12:04:26.964: W/System.err(9329): at android.os.Handler.dispatchMessage(Handler.java:99) 02-18 12:04:26.964: W/System.err(9329): at android.os.Looper.loop(Looper.java:137) 02-18 12:04:26.964: W/System.err(9329): at android.app.ActivityThread.main(ActivityThread.java:4898) 02-18 12:04:26.964: W/System.err(9329): at java.lang.reflect.Method.invokeNative(Native Method) 02-18 12:04:26.964: W/System.err(9329): at java.lang.reflect.Method.invoke(Method.java:511) 02-18 12:04:26.964: W/System.err(9329): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008) 02-18 12:04:26.964: W/System.err(9329): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775) 02-18 12:04:26.964: W/System.err(9329): at dalvik.system.NativeStart.main(Native Method)

but when i try to copy libopencv_java and libopencv_info to the lib/arm7v it get deleted automatically by eclipse ! but libnative cameras are ok any idea ?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2013-02-18 04:56:04 -0600

You try to use static initialization of OpenCV without Manager. In this case all OpenCV shared libraries must be packed to application package.

  1. If your application has native part, then add

    OPENCV_CAMERA_MODULES := on OPENCV_INSTALL_MODULES := on

before "include ../../sdk/native/jni/OpenCV.mk" string. After that OpenCV libraries will be automatically added to package at every build.

  1. If you do not have jni code, then Eclipse does not clean libs folder and you can just copy libraries there. Alternatively you can create jni/Android.mk file and add following code there:

    OPENCV_CAMERA_MODULES := on OPENCV_INSTALL_MODULES := on include ../../sdk/native/jni/OpenCV.mk

edit flag offensive delete link more

Comments

actualy camers dlls are get copied automatically but opencv_java and opencv_info are not :( !

yamen ajjour gravatar imageyamen ajjour ( 2013-02-18 05:13:24 -0600 )edit

why is the wrapper trying to load opencv_java and opencv_info although i am linking aginst opencv statically ? isn't enough to add OPENCV_CAMERA_MODULES := on OPENCV_INSTALL_MODULES := on OPENCV_LIB_TYPE:=STATIC to the android.mk of the project ?

yamen ajjour gravatar imageyamen ajjour ( 2013-02-18 05:35:30 -0600 )edit
1

OPENCV_LIB_TYPE:=STATIC option is valid for C/C++ code. It ask linker to put all used OpenCV routines to your target library. Java wrappers always use shared libraries.

Alexander Smorkalov gravatar imageAlexander Smorkalov ( 2013-02-18 05:41:52 -0600 )edit

so what is wrong ? i unzipped the apk of the application and it contains no open_java ! what do you suggest sir ? by the way i uninstalled the opencv manager sdk and pack عراسي ترد

yamen ajjour gravatar imageyamen ajjour ( 2013-02-18 05:45:17 -0600 )edit

OPENCV_LIB_TYPE:=STATIC disable shared library installation. Use common shared libraries for you native code and for Java wrappers.

Alexander Smorkalov gravatar imageAlexander Smorkalov ( 2013-02-18 10:36:06 -0600 )edit

i loaded them manually and it worked thank you

yamen ajjour gravatar imageyamen ajjour ( 2013-02-18 11:38:16 -0600 )edit

Question Tools

Stats

Asked: 2013-02-18 04:14:56 -0600

Seen: 15,181 times

Last updated: Feb 18 '13