buildscript {
repositories {
//jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle-experimental:0.7.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#OPENCV_CAMERA_MODULES:=off
#OPENCV_INSTALL_MODULES:=off
#OPENCV_LIB_TYPE:=SHARED
include ../../sdk/native/jni/OpenCV.mk
LOCAL_SRC_FILES := StopSignDetection.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)
LOCAL_LDLIBS += -llog -ldl
LOCAL_MODULE := StopSignDetection
include $(BUILD_SHARED_LIBRARY)
My error log:
08-24 15:39:48.895 7905-7905/cn.truthvision.stopsignproject E/AndroidRuntime: FATAL EXCEPTION: main
Process: cn.truthvision.stopsignproject, PID: 7905
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/cn.truthvision.stopsignproject-2/base.apk"],nativeLibraryDirectories=[/data/app/cn.truthvision.stopsignproject-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libjniopencv_core.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:597)
at org.bytedeco.javacpp.Loader.load(Loader.java:438)
at org.bytedeco.javacpp.Loader.load(Loader.java:381)
at org.bytedeco.javacpp.opencv_core.(opencv_core.java:10)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at org.bytedeco.javacpp.Loader.load(Loader.java:413)
at org.bytedeco.javacpp.Loader.load(Loader.java:381)
at org.bytedeco.javacpp.helper.opencv_core$AbstractArray.(opencv_core.java:109)
at cn.truthvision.stopsignproject.AutoRecording.initRecorder(AutoRecording.java:531)
at cn.truthvision.stopsignproject.AutoRecording.onCreate(AutoRecording.java:208)
at android.app.Activity.performCreate(Activity.java:6557)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3096)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3252)
at android.app.ActivityThread.access$1000(ActivityThread.java:197)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1671)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6892)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/cn.truthvision.stopsignproject-2/base.apk"],nativeLibraryDirectories=[/data/app/cn.truthvision.stopsignproject-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libopencv_imgproc.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:597)
at org.bytedeco.javacpp.Loader.load(Loader.java:429)
at org.bytedeco.javacpp.Loader.load(Loader.java:381)
at org.bytedeco.javacpp.opencv_core.(opencv_core.java:10)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at org.bytedeco.javacpp.Loader.load(Loader.java:413)
at org.bytedeco.javacpp.Loader.load(Loader.java:381)
at org.bytedeco.javacpp.helper.opencv_core$AbstractArray.(opencv_core.java:109)
at cn.truthvision.stopsignproject.AutoRecording.initRecorder(AutoRecording.java:531)
at cn.truthvision.stopsignproject.AutoRecording.onCreate(AutoRecording.java:208)
at android.app.Activity.performCreate(Activity.java:6557)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3096)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3252)
at android.app.ActivityThread.access$1000(ActivityThread.java:197)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1671)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6892)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
I am working on live video processing using opencv and javacv. Unfortunately, I have continued to run into the run time error titled above.
The following is my project structure:
In the jniLibs folder, I included the opencv.jar, javacv.jar, javacpp.jar, and ffmpeg.jar.
Build.gradle (Module: app): apply plugin: 'com.android.model.application'
Build.gradle (Project: StopSignProject):
Android.mk:
My error log:
08-24 15:39:48.895 7905-7905/cn.truthvision.stopsignproject E/AndroidRuntime: FATAL EXCEPTION: main Process: cn.truthvision.stopsignproject, PID: 7905 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/cn.truthvision.stopsignproject-2/base.apk"],nativeLibraryDirectories=[/data/app/cn.truthvision.stopsignproject-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libjniopencv_core.so" at java.lang.Runtime.loadLibrary(Runtime.java:366) at java.lang.System.loadLibrary(System.java:988) at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:597) at org.bytedeco.javacpp.Loader.load(Loader.java:438) at org.bytedeco.javacpp.Loader.load(Loader.java:381) at org.bytedeco.javacpp.opencv_core.(opencv_core.java:10)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at org.bytedeco.javacpp.Loader.load(Loader.java:413)
at org.bytedeco.javacpp.Loader.load(Loader.java:381)
at org.bytedeco.javacpp.helper.opencv_core$AbstractArray.(opencv_core.java:109)
at cn.truthvision.stopsignproject.AutoRecording.initRecorder(AutoRecording.java:531)
at cn.truthvision.stopsignproject.AutoRecording.onCreate(AutoRecording.java:208)
at android.app.Activity.performCreate(Activity.java:6557)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3096)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3252)
at android.app.ActivityThread.access$1000(ActivityThread.java:197)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1671)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6892)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/cn.truthvision.stopsignproject-2/base.apk"],nativeLibraryDirectories=[/data/app/cn.truthvision.stopsignproject-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libopencv_imgproc.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:597)
at org.bytedeco.javacpp.Loader.load(Loader.java:429)
at org.bytedeco.javacpp.Loader.load(Loader.java:381)
at org.bytedeco.javacpp.opencv_core.(opencv_core.java:10)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at org.bytedeco.javacpp.Loader.load(Loader.java:413)
at org.bytedeco.javacpp.Loader.load(Loader.java:381)
at org.bytedeco.javacpp.helper.opencv_core$AbstractArray.(opencv_core.java:109)
at cn.truthvision.stopsignproject.AutoRecording.initRecorder(AutoRecording.java:531)
at cn.truthvision.stopsignproject.AutoRecording.onCreate(AutoRecording.java:208)
at android.app.Activity.performCreate(Activity.java:6557)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3096)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3252)
at android.app.ActivityThread.access$1000(ActivityThread.java:197)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1671)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6892)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Any help is appreciated! Thanks!