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

Cannot find lib libjniopencv_core.so #572

Closed
michalisKolozoff opened this issue Nov 30, 2016 · 19 comments
Closed

Cannot find lib libjniopencv_core.so #572

michalisKolozoff opened this issue Nov 30, 2016 · 19 comments

Comments

@michalisKolozoff
Copy link

Hello, I am trying to use openCV in a face recognition application. I have included openCV3.1 in my project following issue #5862, but my application still crashes. I get the exception:

java.lang.UnsatisfiedLinkError: com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader[DexPathList[[dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-javacv_1114b309da76c7e9985fae878d9033bdea43b23e-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-javacpp_0ec04ba422642184c497d1aecd8910efc28f3205-classes.dex", dex file "/data/data/eu.upcom.recred.facerec/files/instant-run/dex/slice-javacpp-0.11_6c6800d74e6c59d3746abfb094d3ee9c2e02478f-classes.dex"],nativeLibraryDirectories=[/data/app/eu.upcom.recred.facerec-1/lib/arm, /data/app/eu.upcom.recred.facerec-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libjniopencv_core.so"

following issue #314 I changed my gradle to

`dependencies {
compile project(':openCVLibrary310')
compile files('libs/javacpp.jar')
compile files('libs/javacv.jar')

compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '2.4.11-0.11', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '2.4.11-0.11', classifier: 'android-x86'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.6.1-0.11', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.6.1-0.11', classifier: 'android-x86'

}

`

@saudet
Copy link
Member

saudet commented Nov 30, 2016

Please try again with JavaCV 1.2.

@michalisKolozoff
Copy link
Author

changed my gradle to

dependencies { compile files('libs/javacpp.jar') compile files('libs/javacv.jar') compile project(':openCVLibrary310') compile 'org.bytedeco:javacv:1.2' compile 'org.bytedeco.javacpp-presets:opencv:3.1.0-1.2' compile 'org.bytedeco.javacpp-presets:ffmpeg:3.0.2-1.2' }

and still the same error

@michalisKolozoff
Copy link
Author

I cannot use javaCV 1.2 because some classes have been changed. My problem still persists. How can I add libjniopencv_core.so

@saudet saudet added the question label Dec 1, 2016
@saudet
Copy link
Member

saudet commented Dec 1, 2016

@saudet saudet closed this as completed Dec 1, 2016
@michalisKolozoff
Copy link
Author

I do not use System.loadLibrary in my project. Isn't linker responsible for fixing loadLibrary?

@michalisKolozoff
Copy link
Author

My question is not answered however. I still get the UnsatisfiedLinkError exception when I am trying to execure faceRecognizer = createLBPHFaceRecognizer(2,8,8,8,200);

@saudet
Copy link
Member

saudet commented Dec 2, 2016

Ok, try this workaround: #470 (comment)

@michalisKolozoff
Copy link
Author

michalisKolozoff commented Dec 2, 2016

I am already using openCV 2.4.1 and as I said I do not load any libraries dynamically, except for the

import static com.googlecode.javacv.cpp.opencv_core.IPL_DEPTH_8U;
import static com.googlecode.javacv.cpp.opencv_highgui.cvLoadImage;
import static com.googlecode.javacv.cpp.opencv_imgproc.CV_BGR2GRAY;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvCvtColor;
import static com.googlecode.javacv.cpp.opencv_contrib.*;

this workaround suggests that I should call

Loader.load(opencv_objdetect.class);

Tried to load the library the same error persists

@saudet
Copy link
Member

saudet commented Dec 2, 2016

Well, if you would like to update to JavaCV 1.2, please tell me about what API changes you are having problems with and I could help you with that.

@libathos
Copy link

libathos commented Dec 6, 2016

Ok thank you very much for your support. Right now, I do not know why, but without having changed anything, the code works.. sometimes. Let me explain. As I said I use in my project openCV 2.4.1 I use a javaCV and javacpp jars which I cannot accurately tell you their version as this is a legacy code handed onto me. And by downloading the openCV sdk for android I installed in my phone the openCV manager 2.4.10.0 rev1 for armv7a neon. When I start the application it prompts for a openCV manager to be installed, then I choose no as There already is an openCV manager. Then I go run openCV manager and switch the to app again, then It runs as it should. Can you guess why this bug appears? Thank you again for your support

@saudet
Copy link
Member

saudet commented Dec 6, 2016

Sounds like a bug with the OpenCV Manager. That's unrelated to JavaCV.

@libathos
Copy link

libathos commented Dec 6, 2016

Cannot tell for sure, Is there any way to incorporate openCV manager dependant files into my application in order not to need to have openCV manager installed?

@saudet
Copy link
Member

saudet commented Dec 6, 2016

That's what JavaCV does, so use JavaCV instead of OpenCV Manager.

@libathos
Copy link

libathos commented Dec 6, 2016

But there are some classes that are within the openCV and not in JavaCV like the
CvCameraViewListener2 etc...

@libathos
Copy link

libathos commented Dec 7, 2016

I can post the imports that are in the openCV framework and not in the javaCV to check if we can resolve the conflicts.

@saudet
Copy link
Member

saudet commented Dec 7, 2016

Well, you'll need to do some refactoring if you want to get rid of CvCameraViewListener2. There isn't a drop in replacement for that.

@libathos
Copy link

libathos commented Dec 7, 2016

Look as I said this is a legacy code and CVCameraViewListener2 is just an example there are other classes too, I do not believe it is worthwhile. So, In your opinion not finding the manager is a openCV issue rather that a javaCV?

@saudet
Copy link
Member

saudet commented Dec 7, 2016

Yes, JavaCV doesn't use the manager.

@libathos
Copy link

libathos commented Dec 7, 2016

ok thanks :)

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

No branches or pull requests

3 participants