himanshukandwal / javacv

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

JavaCV for android crashes #52

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Follow the tutorial for android (using 2.0 as base sdk) on the front page
2. Call Loader.load(opencv_objdetect.class); in onCreate of an activity
3. Crash

What is the expected output? What do you see instead?
No crash. A crash (see below).

What version of the product are you using? On what operating system?
javacv-bin-20110219.zip (18.Feb)
OpenCV-2.2.0-android.zip (18.Feb)
Mac OS X 10.6.6; eclipse Helios; latest android developer tools

Please provide any additional information below.

Loader.load(opencv_objdetect.class);
03-02 16:06:27.865: ERROR/dalvikvm(444): Could not find method 
java.util.Properties.load, referenced from method 
com.googlecode.javacpp.Loader.getProperties
03-02 16:06:27.875: WARN/dalvikvm(444): VFY: unable to resolve virtual method 
8955: Ljava/util/Properties;.load (Ljava/io/Reader;)V
03-02 16:06:27.875: WARN/dalvikvm(444): VFY:  rejecting opcode 0x6e at 0x002e
03-02 16:06:27.875: WARN/dalvikvm(444): VFY:  rejected 
Lcom/googlecode/javacpp/Loader;.getProperties 
(Ljava/lang/String;)Ljava/util/Properties;
03-02 16:06:27.875: WARN/dalvikvm(444): Verifier rejected class 
Lcom/googlecode/javacpp/Loader;
03-02 16:06:27.875: DEBUG/AndroidRuntime(444): Shutting down VM
03-02 16:06:27.875: WARN/dalvikvm(444): threadid=3: thread exiting with 
uncaught exception (group=0x4001da28)
03-02 16:06:27.885: ERROR/AndroidRuntime(444): Uncaught handler: thread main 
exiting due to uncaught exception
03-02 16:06:28.016: ERROR/AndroidRuntime(444): java.lang.VerifyError: 
com.googlecode.javacpp.Loader
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
com.seclabs.droidfinger.DroidFingerCamera.onCreate(DroidFingerCamera.java:47)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
android.app.ActivityThread.access$2100(ActivityThread.java:116)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
android.os.Looper.loop(Looper.java:123)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
android.app.ActivityThread.main(ActivityThread.java:4203)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
java.lang.reflect.Method.invokeNative(Native Method)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
java.lang.reflect.Method.invoke(Method.java:521)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
03-02 16:06:28.016: ERROR/AndroidRuntime(444):     at 
dalvik.system.NativeStart.main(Native Method)

Original issue reported on code.google.com by heiko.wi...@gmail.com on 2 Mar 2011 at 3:17

GoogleCodeExporter commented 8 years ago
As indicated in the README.txt file, it won't work with less than SDK API 8 
(this is Android 2.2). (I wrote API 9 actually, but found that 8 also works). 
So, Android 2.0 will not work, sorry. Hacking a whole bunch of stuff could make 
it work, but I think it's easier to upgrade to 2.2.

Original comment by samuel.a...@gmail.com on 3 Mar 2011 at 3:29

GoogleCodeExporter commented 8 years ago
I also have crash with like error. I run app on the emulator with 2.2. JavaCV 
does not work on an emulator?

Original comment by yuriy.ch...@gmail.com on 8 May 2011 at 7:43

GoogleCodeExporter commented 8 years ago
Yuriy, your issue is different, try this:
http://code.google.com/p/javacv/issues/detail?id=60#c6

Original comment by samuel.a...@gmail.com on 9 May 2011 at 1:59

GoogleCodeExporter commented 8 years ago
07-18 01:01:05.067: I/dalvikvm(282): Could not find method 
java.util.Properties.load, referenced from method 
com.googlecode.javacpp.Loader.getProperties
07-18 01:01:05.077: W/dalvikvm(282): VFY: unable to resolve virtual method 
16478: Ljava/util/Properties;.load (Ljava/io/Reader;)V
07-18 01:01:05.077: D/dalvikvm(282): VFY: replacing opcode 0x6e at 0x002e
07-18 01:01:05.077: I/dalvikvm(282): Could not find method 
java.util.Properties.load, referenced from method 
com.googlecode.javacpp.Loader.getProperties
07-18 01:01:05.077: W/dalvikvm(282): VFY: unable to resolve virtual method 
16478: Ljava/util/Properties;.load (Ljava/io/Reader;)V
07-18 01:01:05.077: D/dalvikvm(282): VFY: replacing opcode 0x6e at 0x0045
07-18 01:01:05.077: D/dalvikvm(282): VFY: dead code 0x0048-0048 in 
Lcom/googlecode/javacpp/Loader;.getProperties 
(Ljava/lang/String;)Ljava/util/Properties;
07-18 01:01:05.338: D/dalvikvm(282): GC_FOR_MALLOC freed 2329 objects / 213136 
bytes in 75ms
07-18 01:01:05.564: I/dalvikvm-heap(282): Grow heap (frag case) to 4.087MB for 
919887-byte allocation
07-18 01:01:05.702: D/dalvikvm(282): GC_FOR_MALLOC freed 254 objects / 12952 
bytes in 136ms
07-18 01:01:06.187: D/dalvikvm(282): Trying to load lib 
/data/data/com.example.javacv/lib/libavutil.so 0x43e37258
07-18 01:01:06.187: D/dalvikvm(282): Added shared lib 
/data/data/com.example.javacv/lib/libavutil.so 0x43e37258
07-18 01:01:06.187: D/dalvikvm(282): No JNI_OnLoad found in 
/data/data/com.example.javacv/lib/libavutil.so 0x43e37258, skipping init
07-18 01:01:06.197: W/dalvikvm(282): Exception Ljava/lang/UnsatisfiedLinkError; 
thrown during Lcom/googlecode/javacv/cpp/avutil;.<clinit>
07-18 01:01:06.197: W/dalvikvm(282): Exception 
Ljava/lang/ExceptionInInitializerError; thrown during 
Lcom/googlecode/javacv/cpp/avcodec;.<clinit>
07-18 01:01:06.197: W/dalvikvm(282): Exception 
Ljava/lang/ExceptionInInitializerError; thrown during 
Lcom/googlecode/javacv/cpp/avformat;.<clinit>
07-18 01:01:06.258: D/dalvikvm(282): Trying to load lib 
/data/data/com.example.javacv/lib/libopencv_core.so 0x43e37258
07-18 01:01:06.530: D/dalvikvm(282): Added shared lib 
/data/data/com.example.javacv/lib/libopencv_core.so 0x43e37258
07-18 01:01:06.530: D/dalvikvm(282): No JNI_OnLoad found in 
/data/data/com.example.javacv/lib/libopencv_core.so 0x43e37258, skipping init
07-18 01:01:06.538: W/dalvikvm(282): Exception Ljava/lang/UnsatisfiedLinkError; 
thrown during Lcom/googlecode/javacv/cpp/opencv_core;.<clinit>
07-18 01:01:06.538: W/dalvikvm(282): Exception 
Ljava/lang/ExceptionInInitializerError; thrown during 
Lcom/googlecode/javacv/cpp/opencv_imgproc;.<clinit>
07-18 01:01:06.538: W/dalvikvm(282): Exception 
Ljava/lang/ExceptionInInitializerError; thrown during 
Lcom/googlecode/javacv/cpp/opencv_highgui;.<clinit>
07-18 01:01:06.538: W/dalvikvm(282): Exception 
Ljava/lang/ExceptionInInitializerError; thrown during 
Lcom/googlecode/javacv/cpp/opencv_features2d;.<clinit>
07-18 01:01:06.538: W/dalvikvm(282): Exception 
Ljava/lang/ExceptionInInitializerError; thrown during 
Lcom/googlecode/javacv/cpp/opencv_objdetect;.<clinit>
07-18 01:01:06.548: D/AndroidRuntime(282): Shutting down VM
07-18 01:01:06.548: W/dalvikvm(282): threadid=1: thread exiting with uncaught 
exception (group=0x4001d800)
07-18 01:01:06.727: E/AndroidRuntime(282): FATAL EXCEPTION: main
07-18 01:01:06.727: E/AndroidRuntime(282): java.lang.ExceptionInInitializerError
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.Class.classForName(Native Method)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.Class.forName(Class.java:235)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacpp.Loader.load(Loader.java:314)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.example.javacv.FaceView.<init>(MainActivity.java:92)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.example.javacv.MainActivity.onCreate(MainActivity.java:51)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
android.os.Handler.dispatchMessage(Handler.java:99)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
android.os.Looper.loop(Looper.java:123)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
android.app.ActivityThread.main(ActivityThread.java:4627)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.reflect.Method.invokeNative(Native Method)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.reflect.Method.invoke(Method.java:521)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
dalvik.system.NativeStart.main(Native Method)
07-18 01:01:06.727: E/AndroidRuntime(282): Caused by: 
java.lang.ExceptionInInitializerError
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.Class.classForName(Native Method)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.Class.forName(Class.java:235)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacpp.Loader.load(Loader.java:314)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacv.cpp.opencv_objdetect.<clinit>(opencv_objdetect.java:97)
07-18 01:01:06.727: E/AndroidRuntime(282):  ... 18 more
07-18 01:01:06.727: E/AndroidRuntime(282): Caused by: 
java.lang.ExceptionInInitializerError
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.Class.classForName(Native Method)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.Class.forName(Class.java:235)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacpp.Loader.load(Loader.java:314)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacv.cpp.opencv_features2d.<clinit>(opencv_features2d.java:93)
07-18 01:01:06.727: E/AndroidRuntime(282):  ... 22 more
07-18 01:01:06.727: E/AndroidRuntime(282): Caused by: 
java.lang.ExceptionInInitializerError
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.Class.classForName(Native Method)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.Class.forName(Class.java:235)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacpp.Loader.load(Loader.java:314)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:91)
07-18 01:01:06.727: E/AndroidRuntime(282):  ... 26 more
07-18 01:01:06.727: E/AndroidRuntime(282): Caused by: 
java.lang.ExceptionInInitializerError
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.Class.classForName(Native Method)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.Class.forName(Class.java:235)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacpp.Loader.load(Loader.java:314)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:96)
07-18 01:01:06.727: E/AndroidRuntime(282):  ... 30 more
07-18 01:01:06.727: E/AndroidRuntime(282): Caused by: 
java.lang.UnsatisfiedLinkError: Library jniopencv_core not found
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.Runtime.loadLibrary(Runtime.java:461)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
java.lang.System.loadLibrary(System.java:557)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacpp.Loader.load(Loader.java:367)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacpp.Loader.load(Loader.java:294)
07-18 01:01:06.727: E/AndroidRuntime(282):  at 
com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:129)
07-18 01:01:06.727: E/AndroidRuntime(282):  ... 34 more

Original comment by eTECH...@gmail.com on 18 Jul 2012 at 1:25