Ashish74 / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

Caused by: java.lang.UnsatisfiedLinkError: Couldn't load opencv_core from loader dalvik.system.PathClassLoader #501

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.trying to run a program on android that uses javacv library 
2.exception at "opencv_core.Mat a = imread(file1Path);"
3.I have the followng jars 
    1.javacv.jar
   2.javacpp.jar
   3.opencv.jar
   4.opencv-android-arm.jar
  5.opencv-android-x86.jar
What is the expected output? What do you see instead?
A mat object has to be created. It gives the exception during run time. The 
exception is :

W/dalvikvm( 6470): Exception Ljava/lang/UnsatisfiedLinkError; thrown while 
initializing Lorg/bytedeco/javacpp/opencv_core;
W/dalvikvm( 6470): Exception Ljava/lang/NoClassDefFoundError; thrown while 
initializing Lorg/bytedeco/javacpp/opencv_highgui;
W/dalvikvm( 6470): threadid=24: thread exiting with uncaught exception 
(group=0x41733d40)
I/BUG2GO-Util( 7986): savePropertiesToFile 
/data/data/com.motorola.bug2go/files/lastEvent.properties
E/AndroidRuntime( 6470): FATAL EXCEPTION: 
IntentService[SRAVANJuxtaposeImageMixService]
E/AndroidRuntime( 6470): Process: com.motorola.camera, PID: 6470
E/AndroidRuntime( 6470): java.lang.NoClassDefFoundError: 
java.lang.ClassNotFoundException: org.bytedeco.javacpp.opencv_core
E/AndroidRuntime( 6470):    at org.bytedeco.javacpp.Loader.load(Loader.java:387)
E/AndroidRuntime( 6470):    at org.bytedeco.javacpp.Loader.load(Loader.java:353)
E/AndroidRuntime( 6470):    at 
org.bytedeco.javacpp.opencv_highgui.<clinit>(opencv_highgui.java:13)
E/AndroidRuntime( 6470):    at 
com.motorola.camera.device.JuxtaposeImageMixService$HandleImageMix.run(Juxtapose
ImageMixService.java:159)
E/AndroidRuntime( 6470):    at 
com.motorola.camera.device.JuxtaposeImageMixService.handleIntent(JuxtaposeImageM
ixService.java:77)
E/AndroidRuntime( 6470):    at 
com.motorola.camera.device.JuxtaposeImageMixService.onHandleIntent(JuxtaposeImag
eMixService.java:71)
E/AndroidRuntime( 6470):    at 
android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
E/AndroidRuntime( 6470):    at 
android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 6470):    at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 6470):    at android.os.HandlerThread.run(HandlerThread.java:61)
E/AndroidRuntime( 6470): Caused by: java.lang.ClassNotFoundException: 
org.bytedeco.javacpp.opencv_core
E/AndroidRuntime( 6470):    at java.lang.Class.classForName(Native Method)
E/AndroidRuntime( 6470):    at java.lang.Class.forName(Class.java:251)
E/AndroidRuntime( 6470):    at org.bytedeco.javacpp.Loader.load(Loader.java:385)
E/AndroidRuntime( 6470):    ... 9 more
E/AndroidRuntime( 6470): Caused by: java.lang.UnsatisfiedLinkError: Couldn't 
load jniopencv_core from loader dalvik.system.PathClassLoader[DexPathList[[zip 
file "/system/framework/com.motorola.motosignature.jar", zip file 
"/system/framework/com.motorola.frameworks.core.addon.jar", zip file 
"/data/app/com.motorola.camera-2.apk"],nativeLibraryDirectories=[/data/app-lib/c
om.motorola.camera-2, /vendor/lib, /system/lib]]]: findLibrary returned null
E/AndroidRuntime( 6470):    at java.lang.Runtime.loadLibrary(Runtime.java:358)
E/AndroidRuntime( 6470):    at java.lang.System.loadLibrary(System.java:526)
E/AndroidRuntime( 6470):    at 
org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
E/AndroidRuntime( 6470):    at org.bytedeco.javacpp.Loader.load(Loader.java:410)
E/AndroidRuntime( 6470):    at org.bytedeco.javacpp.Loader.load(Loader.java:353)
E/AndroidRuntime( 6470):    at 
org.bytedeco.javacpp.opencv_core.<clinit>(opencv_core.java:10)
E/AndroidRuntime( 6470):    ... 12 more
E/AndroidRuntime( 6470): Caused by: java.lang.UnsatisfiedLinkError: Couldn't 
load opencv_core from loader dalvik.system.PathClassLoader[DexPathList[[zip 
file "/system/framework/com.motorola.motosignature.jar", zip file 
"/system/framework/com.motorola.frameworks.core.addon.jar", zip file 
"/data/app/com.motorola.camera-2.apk"],nativeLibraryDirectories=[/data/app-lib/c
om.motorola.camera-2, /vendor/lib, /system/lib]]]: findLibrary returned null
E/AndroidRuntime( 6470):    at java.lang.Runtime.loadLibrary(Runtime.java:358)
E/AndroidRuntime( 6470):    at java.lang.System.loadLibrary(System.java:526)
E/AndroidRuntime( 6470):    at 
org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
E/AndroidRuntime( 6470):    at org.bytedeco.javacpp.Loader.load(Loader.java:401)
E/AndroidRuntime( 6470):    ... 14 more

What version of the product are you using? On what operating system?
I have downloaded the javacv packages from 
"https://github.com/bytedeco/javacv#sample-usage" on mac os

Please provide any additional information below.
I feel that the opencv_core class is not going into the apk as it does not give 
me any errors during compile time.
My import statements are:
import org.bytedeco.javacpp.opencv_core;
import static org.bytedeco.javacpp.opencv_highgui.imread; 

Original issue reported on code.google.com by gop...@motorola.com on 10 Mar 2015 at 3:38

GoogleCodeExporter commented 8 years ago
If you are not using Android Studio, please try again with Android Studio.

And please post on GitHub, if possible, this site is no longer maintained, 
thank you!

Original comment by samuel.a...@gmail.com on 10 Mar 2015 at 7:37