OpenCV fails to load after upgrading to Android 5.02

asked 2015-02-24 12:11:03 -0600

alexz gravatar image

updated 2015-02-24 17:59:15 -0600

My application worked fine on Android 4.4.4. After upgrading OS to Android 5.02 OpenCV fails to load. My code is:

public void onResume()
    {
        super.onResume();
        OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_9, this, mLoaderCallback);
}

The stack trace shows that it fails in OpenCV code in the file AsyncServiceHelper.java line 24 it throws exception:

if (AppContext.bindService(new Intent("org.opencv.engine.BIND"),
                helper.mServiceConnection, Context.BIND_AUTO_CREATE))

Has somebody experienced this problem? Re-installing OpenCV Manager does not help. I also took new device with Android 5.02 and installed OpenCV. The app still fails to load. The hardware I tried so far is Nexus 7 and Nexus 4.

Update

I reversed the system back to 4.4.4 and app started working again. I still cannot understand what is wrong with my app in 5.0.2. Other OpenCV applications work just fine.

edit retag flag offensive close merge delete

Comments

Ministro for Qt, after which OpenCV Manager is modelled, is having the same problem, and what breaks it is a deliberate change in design for Android 5 (no more world-readable files). If the issue is the same, then it's likely that it will never be fixed, and OpenCV has to be built separately into every application that uses it again (if you want Android 5 compatibility).

You could try following instructions for "Static Initialization" from this tutorial and see if it will work on Android 5.

Here is a discussion on it, with information on Ministro specifically.

Anamon gravatar imageAnamon ( 2015-04-16 08:59:15 -0600 )edit