How can I resolve this issue?
I've just copy javacv jar files under my project Lib
folder and got this error!
I can find this thread from google but the page can not be opened because of google restrictions policy in my country unfortunately.
The reason I include these jars in my android application is that I do not want to use openCV manager
. I want to statically link openCV
library to my project. I am trying to run my app on Samsung Galaxy S5
.
Here is the LogCat
errors I've got:
[2014-07-16 10:13:57 - face-recognition] The library 'javacv-android-arm.jar' contains native libraries that will not run on the device.
[2014-07-16 10:13:57 - face-recognition] The following libraries were found:
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniARToolKitPlus.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniavcodec.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniavdevice.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniavfilter.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniavformat.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniavutil.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjnicvkernels.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_calib3d.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_contrib.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_core.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_features2d.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_flann.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_highgui.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_imgproc.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_legacy.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_ml.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_nonfree.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_objdetect.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_photo.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_stitching.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_video.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniopencv_videostab.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjnipostproc.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniswresample.so
[2014-07-16 10:13:57 - face-recognition] - com/googlecode/javacv/cpp/android-arm/libjniswscale.so
EDIT-1
After I follow the instruction in here, thanks to PRAKASH I could resolve these errors, but I have got other errors which are totally related to NoClassDefFoundError
. I really give up. I can not resolve the issue, so any help would be really appreciated. Here are my new errors:
07-22 08:48:54.472: E/dalvikvm(11694): Could not find class 'com.googlecode.javacv.cpp.opencv_core$MatVector', referenced from method org.opencv.javacv.facerecognition.PersonRecognizer.train
07-22 08:48:54.472: W/dalvikvm(11694): VFY: unable to resolve new-instance 108 (Lcom/googlecode/javacv/cpp/opencv_core$MatVector;) in Lorg/opencv/javacv/facerecognition/PersonRecognizer;
07-22 08:48:54.472: D/dalvikvm(11694): VFY: replacing opcode 0x22 at 0x001c
07-22 08:48:54.472: D/dalvikvm(11694): DexOpt: unable to opt direct call 0x00c9 at 0x28 in Lorg/opencv/javacv/facerecognition/PersonRecognizer;.train
07-22 08:48:54.472: D/AndroidRuntime(11694): Shutting down VM
07-22 08:48:54.472: W/dalvikvm(11694): threadid=1: thread exiting with uncaught exception (group=0x41737c08)
07-22 08:48:54.477: E/AndroidRuntime(11694): FATAL EXCEPTION: main
07-22 08:48:54.477: E/AndroidRuntime(11694): Process: org.opencv.javacv.facerecognition, PID: 11694
07-22 08:48:54.477: E/AndroidRuntime(11694): java.lang.NoClassDefFoundError: com.googlecode.javacv.cpp.opencv_contrib
download Javacv latest version
and extract it and put
ffmpeg.jar
,javacv.jar
,javacpp.jar
and opencv.jar
in libs
folder of your project
and also extract all *.so from extracted
opencv-android-arm.jar,ffmpeg-android-arm.jar files.
and put all *.so files inside libs/armeabi folder
for more information click here
it may solve your problem .
If you haven't yet installed the Android Development Environment, you can follow this link which contains everything you need to get started quickly. Watch the tutorial video and follow the instructions underneath to install Eclipse, the Integrated Development Environment (IDE) for Android development and create a new project.
Once you have installed everything and have created the project, use the following procedure to import JavaCV libraries to the Android project:
Download the JavaCv libraries: a. From this link download "javacv-0.7-bin.zip " and extract the files: - javacpp.jar - javacv.jar - javacv-android-arm.jar b. From this link download "javacv-0.7-cppjars.zip" and extract the files: - opencv-2.4.8-android-arm.jar - ffmpeg-2.1.1-android-arm.jar
Go to File > New > Folder, select your project as parent folder, type "libs/armeabi" as Folder name, and click Finish.
Copy javacpp.jar and javacv.jar into the "libs" folder.
Extract all the *.so files from javacv-android-arm.jar, opencv-2.4.8-android-arm.jar, and ffmpeg-2.1.1-android-arm.jar directly into the "libs/armeabi" folder, without creating any of the subdirectories found in the JAR files. (The easiest way to extract the .so files from the .jar is by using 7-ZIP software which can be downloaded here).
Navigate to Project > Properties > Java Build Path > Libraries and click "Add JARs...".
Select both javacpp.jar and javacv.jar from the "libs" folder.
Finally,import JavaCV functions to your code
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.opencv_highgui.*;
and use some sample code to check that everything is working correctly.
来源:https://stackoverflow.com/questions/24773153/the-library-javacv-android-arm-jar-contains-native-libraries-that-will-not-run