java.lang.ClassNotFoundException:com.googlecode.javacv.cpp.opencv_core

时间:2015-09-22 10:59:01

标签: android maven opencv gradle javacv

我正在我的项目中使用javacv库.libs文件夹的层次结构

libs
-armeabi.jar
 -lib.armeabi
  -libjniopencv_core.so (and other .so files)
-javacv.jar
 -com.googlecode.javacv
  -cpp
   -opencv_core(class)

但是当我尝试在创建的surfaceview上创建yuiplimage时

(yuvIplimage = IplImage.create(w, h, IPL_DEPTH_8U, 1) )

它给出了这个错误

18378-18378/triptam.gofive.likaz E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: java.lang.ClassNotFoundException: com.googlecode.javacv.cpp.opencv_core
            at com.googlecode.javacpp.Loader.load(Loader.java:340)
            at com.googlecode.javacpp.Loader.load(Loader.java:319)
            at com.googlecode.javacv.cpp.opencv_core$CvArr.<clinit>(opencv_core.java:163)
            at triptam.gofive.likazz.MainActivity$CameraView.surfaceChanged(MainActivity.java:1394)
            at android.view.SurfaceView.updateWindow(SurfaceView.java:628)
            at android.view.SurfaceView.access$000(SurfaceView.java:88)
            at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:183)
            at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:695)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2123)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4872)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)
            at android.view.Choreographer.doCallbacks(Choreographer.java:579)
            at android.view.Choreographer.doFrame(Choreographer.java:548)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)
            at android.os.Handler.handleCallback(Handler.java:800)
            at android.os.Handler.dispatchMessage(Handler.java:100)
            at android.os.Looper.loop(Looper.java:194)
            at android.app.ActivityThread.main(ActivityThread.java:5410)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.ClassNotFoundException: com.googlecode.javacv.cpp.opencv_core
            at java.lang.Class.classForName(Native Method)
            at java.lang.Class.forName(Class.java:217)
            at com.googlecode.javacpp.Loader.load(Loader.java:338)
            at com.googlecode.javacpp.Loader.load(Loader.java:319)
            at com.googlecode.javacv.cpp.opencv_core$CvArr.<clinit>(opencv_core.java:163)
            at triptam.gofive.likazz.MainActivity$CameraView.surfaceChanged(MainActivity.java:1394)
            at android.view.SurfaceView.updateWindow(SurfaceView.java:628)
            at android.view.SurfaceView.access$000(SurfaceView.java:88)
            at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:183)
            at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:695)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2123)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4872)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)
            at android.view.Choreographer.doCallbacks(Choreographer.java:579)
            at android.view.Choreographer.doFrame(Choreographer.java:548)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)
            at android.os.Handler.handleCallback(Handler.java:800)
            at android.os.Handler.dispatchMessage(Handler.java:100)
            at android.os.Looper.loop(Looper.java:194)
            at android.app.ActivityThread.main(ActivityThread.java:5410)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.UnsatisfiedLinkError: Couldn't load jniopencv_core from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/triptam.gofive.likaz-1.apk", zip file "/data/data/triptam.gofive.likaz/code_cache/secondary-dexes/triptam.gofive.likaz-1.apk.classes2.zip"],nativeLibraryDirectories=[/data/app-lib/triptam.gofive.likaz-1, /vendor/lib, /system/lib]]]: findLibrary returned null
            at java.lang.Runtime.loadLibrary(Runtime.java:366)
            at java.lang.System.loadLibrary(System.java:514)
            at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:448)
            at com.googlecode.javacpp.Loader.load(Loader.java:372)
            at com.googlecode.javacpp.Loader.load(Loader.java:319)
            at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)
            at java.lang.Class.classForName(Native Method)
            at java.lang.Class.forName(Class.java:217)
            at com.googlecode.javacpp.Loader.load(Loader.java:338)
            at com.googlecode.javacpp.Loader.load(Loader.java:319)
            at com.googlecode.javacv.cpp.opencv_core$CvArr.<clinit>(opencv_core.java:163)
            at triptam.gofive.likazz.MainActivity$CameraView.surfaceChanged(MainActivity.java:1394)
            at android.view.SurfaceView.updateWindow(SurfaceView.java:628)
            at android.view.SurfaceView.access$000(SurfaceView.java:88)
            at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:183)
            at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:695)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2123)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4872)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)
            at android.view.Choreographer.doCallbacks(Choreographer.java:579)
            at android.view.Choreographer.doFrame(Choreographer.java:548)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)
            at android.os.Handler.handleCallback(Handler.java:800)
            at android.os.Handler.dispatchMessage(Handler.java:100)
            at android.os.Looper.loop(Looper.java:194)
            at android.app.ActivityThread.main(ActivityThread.java:5410)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
            at dalvik.system.NativeStart.main(Native Method)

我是本土图书馆的新手,之前工作正常。谢谢提前

0 个答案:

没有答案