Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.UnsatisfiedLinkError about libjniopencv_core.so and libopencv_imgproc.so #314

Closed
Cupcake-iOS opened this issue Jan 22, 2016 · 1 comment
Labels

Comments

@Cupcake-iOS
Copy link

Hello,
I want to implement face recognizer and try import javacv by using gradle,

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:design:22.2.1'
    compile 'org.bytedeco:javacv:1.1'
}

However when I call the function createLBPHFaceRecognizer()
I always get the error message

01-22 19:35:57.633 22594-22594/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: tw.com.championtek.javacvtest, PID: 22594
                                                   java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/tw.com.championtek.javacvtest-1/base.apk"],nativeLibraryDirectories=[/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.<clinit>(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.opencv_face.<clinit>(opencv_face.java:13)
                                                       at tw.com.championtek.javacvtest.MainActivity.onResume(MainActivity.java:38)
                                                       at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1257)
                                                       at android.app.Activity.performResume(Activity.java:6142)
                                                       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3073)
                                                       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3115)
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2446)
                                                       at android.app.ActivityThread.access$800(ActivityThread.java:162)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                       at android.os.Looper.loop(Looper.java:135)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5431)
                                                       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:914)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)
                                                    Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/tw.com.championtek.javacvtest-1/base.apk"],nativeLibraryDirectories=[/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.<clinit>(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.opencv_face.<clinit>(opencv_face.java:13) 
                                                       at tw.com.championtek.javacvtest.MainActivity.onResume(MainActivity.java:38) 
                                                       at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1257) 
                                                       at android.app.Activity.performResume(Activity.java:6142) 
                                                       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3073) 
                                                       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3115) 
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2446) 
                                                       at android.app.ActivityThread.access$800(ActivityThread.java:162) 
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349) 
                                                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                       at android.os.Looper.loop(Looper.java:135) 
                                                       at android.app.ActivityThread.main(ActivityThread.java:5431) 
                                                       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:914) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707) 

Anyone can help me to fix this problem?

Thanks,

Isaac

@saudet
Copy link
Member

saudet commented Jan 22, 2016

You're going to need to list a couple more dependencies for Gradle:
https://github.com/bytedeco/javacv/wiki/Configuring-Proguard-for-JavaCV#gradle-settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants