Ask Your Question
1

Loading OpenCV on android fail sometimes

asked 2013-02-04 11:06:07 -0600

MoHaKa gravatar image

hello, i am working on android app using open cv library, so i have to load open cv on (onResume) of my activity:

try {
    if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, con, new LoaderCallbackInterface() {
            @Override
            public void onPackageInstall(int operation, InstallCallbackInterface callback) {
            }

            @Override
            public void onManagerConnected(int status) {

            }
            })) {
        Toast.makeText(con, "cannot connect to opencv ", Toast.LENGTH_SHORT).show();
    }
} catch (Exception e) {
    e.printStackTrace();
    Log.e("Utilities", "can not load opencv, an exception has been thrown while.");
}

now my problem is sometimes and with unspecific conditions the open cv load fail and give me this LogCat:

V/Main(7042): OnCreate
V/Main(7042): onResume
D/OpenCVManager/Helper(7042): Service connection created
D/OpenCVManager/Helper(7042): Trying to get library path
W/System.err(7042): android.os.DeadObjectException
W/System.err(7042): at android.os.BinderProxy.transact(Native Method)
W/System.err(7042): at org.opencv.engine.OpenCVEngineInterface$Stub$Proxy.getLibPathByVersion(OpenCVEngineInterface.java:137)
W/System.err(7042): at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:182)
W/System.err(7042): at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1097)
W/System.err(7042): at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1114)
W/System.err(7042): at android.os.Handler.handleCallback(Handler.java:615)
W/System.err(7042): at android.os.Handler.dispatchMessage(Handler.java:92)
W/System.err(7042): at android.os.Looper.loop(Looper.java:137)
W/System.err(7042): at android.app.ActivityThread.main(ActivityThread.java:4898)
W/System.err(7042): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(7042): at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err(7042): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
W/System.err(7042): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
W/System.err(7042): at dalvik.system.NativeStart.main(Native Method)
D/OpenCVManager/Helper(7042): Init finished with status 255
D/OpenCVManager/Helper(7042): Unbind from service
D/OpenCVManager/Helper(7042): Calling using callback
E/OpenCVLoader/BaseLoaderCallback(7042): OpenCV loading failed!
D/AndroidRuntime(7042): Shutting down VM
W/dalvikvm(7042): threadid=1: thread exiting with uncaught exception (group=0x420b32a0)

so what is this problem and why "OpenCV loading failed!" and how to solve it? Please answer me as soon as possible :)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-02-04 13:27:24 -0600

It looks like a problem somewhere else, but not in Manager connection itself. I create ticket on bug tracker. Could you update the ticket: attach full logcat output and small reproducer. Phone model and Android version will be useful too.

edit flag offensive delete link more

Comments

OK, i will edit my question

MoHaKa gravatar imageMoHaKa ( 2013-02-05 09:46:47 -0600 )edit

i have updated the ticket, but i wanna ask you: is this problem in my code or it is bug in opencv?

MoHaKa gravatar imageMoHaKa ( 2013-02-05 10:29:42 -0600 )edit

in the ticket Kirill Kornyakov says that my exception has been solved, could you tell me how can i get the solved copy of open cv please?

MoHaKa gravatar imageMoHaKa ( 2013-02-13 11:24:29 -0600 )edit

Some days ago OpenCV 2.4.4 beta published. Try it.

Alexander Smorkalov gravatar imageAlexander Smorkalov ( 2013-02-13 22:13:31 -0600 )edit

Question Tools

Stats

Asked: 2013-02-04 11:06:07 -0600

Seen: 1,638 times

Last updated: Feb 04 '13