I'm having a hell of a time trying to get opencv to work with Android Studio. I've followed all of the obvious tutorials, but can't get the opencv version 2.4.11 sample code to work at all.
The app compiles, but when trying to run it I simply get an error message on the phone:
Unfortunately OCV T3 Camera Control has stopped.
and logcat:
05-02 00:23:37.876 18962-18962/org.opencv.samples.tutorial3 E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.opencv.samples.tutorial3, PID: 18962
java.lang.RuntimeException: Unable to resume activity {org.opencv.samples.tutorial3/org.opencv.samples.tutorial3.Tutorial3Activity}: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=org.opencv.engine.BIND }
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3103)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=org.opencv.engine.BIND }
at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1209)
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1308)
at android.app.ContextImpl.bindService(ContextImpl.java:1286)
at android.content.ContextWrapper.bindService(ContextWrapper.java:604)
at org.opencv.android.AsyncServiceHelper.initOpenCV(AsyncServiceHelper.java:24)
at org.opencv.android.OpenCVLoader.initAsync(OpenCVLoader.java:89)
at org.opencv.samples.tutorial3.Tutorial3Activity.onResume(Tutorial3Activity.java:91)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1258)
at android.app.Activity.performResume(Activity.java:6327)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I'm trying to work with the most current Android Studio version 2.1 and Android version 6.0, which is SDK version 23, but I don't care if earlier versions would suffice. I've seen posts saying that perhaps it is folly to try using these later versions, and that maybe I should use SDK version 21 or 19?
I've tried modifying my build.gradle files to use
minSdkVersion 19
targetSdkVersion 21
and this seems to change nothing.
Please help.