您好我在我的三星Galaxy 2上运行Opencv 2.4.3的第3个教程,当它在eclipse中按'play'时会立即冻结。 没有ndk和c代码的简单样本工作正常。
我附上了Eclipse的LogCat:
01-20 18:33:46.464: I/OCVSample::Activity(17468): Instantiated new class org.opencv.samples.tutorial3.Sample3Native
01-20 18:33:46.464: I/OCVSample::Activity(17468): called onCreate
01-20 18:33:46.474: D/CameraBridge(17468): Attr count: 3
01-20 18:33:46.474: D/JavaCameraView(17468): Java camera view ctor
01-20 18:33:46.574: D/CameraBridge(17468): call surfaceChanged event
01-20 18:33:46.599: D/OpenCVManager/Helper(17468): Service connection created
01-20 18:33:46.599: D/OpenCVManager/Helper(17468): Trying to get library path
01-20 18:33:46.954: D/OpenCVManager/Helper(17468): Trying to get library list
01-20 18:33:47.209: D/OpenCVManager/Helper(17468): Library list: ""
01-20 18:33:47.209: D/OpenCVManager/Helper(17468): First attempt to load libs
01-20 18:33:47.209: D/OpenCVManager/Helper(17468): Trying to init OpenCV libs
01-20 18:33:47.209: D/OpenCVManager/Helper(17468): Trying to load library /data/data/org.opencv.engine/lib/libopencv_java.so
01-20 18:33:47.209: D/dalvikvm(17468): Trying to load lib /data/data/org.opencv.engine/lib/libopencv_java.so 0x4158b5d0
01-20 18:33:47.224: D/dalvikvm(17468): Added shared lib /data/data/org.opencv.engine/lib/libopencv_java.so 0x4158b5d0
01-20 18:33:47.224: D/OpenCVManager/Helper(17468): OpenCV libs init was ok!
01-20 18:33:47.224: D/OpenCVManager/Helper(17468): First attempt to load libs is OK
01-20 18:33:47.224: D/OpenCVManager/Helper(17468): Init finished with status 0
01-20 18:33:47.224: D/OpenCVManager/Helper(17468): Unbind from service
01-20 18:33:47.224: D/OpenCVManager/Helper(17468): Calling using callback
01-20 18:33:47.229: I/OCVSample::Activity(17468): OpenCV loaded successfully
01-20 18:33:47.229: D/AndroidRuntime(17468): Shutting down VM
01-20 18:33:47.229: W/dalvikvm(17468): threadid=1: thread exiting with uncaught exception (group=0x40c871f8)
01-20 18:33:47.229: E/AndroidRuntime(17468): FATAL EXCEPTION: main
01-20 18:33:47.229: E/AndroidRuntime(17468): java.lang.UnsatisfiedLinkError: Couldn't load native_sample: findLibrary returned null
01-20 18:33:47.229: E/AndroidRuntime(17468): at java.lang.Runtime.loadLibrary(Runtime.java:365)
01-20 18:33:47.229: E/AndroidRuntime(17468): at java.lang.System.loadLibrary(System.java:535)
01-20 18:33:47.229: E/AndroidRuntime(17468): at org.opencv.samples.tutorial3.Sample3Native$1.onManagerConnected(Sample3Native.java:33)
01-20 18:33:47.229: E/AndroidRuntime(17468): at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:314)
01-20 18:33:47.229: E/AndroidRuntime(17468): at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1068)
01-20 18:33:47.229: E/AndroidRuntime(17468): at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1085)
01-20 18:33:47.229: E/AndroidRuntime(17468): at android.os.Handler.handleCallback(Handler.java:605)
01-20 18:33:47.229: E/AndroidRuntime(17468): at android.os.Handler.dispatchMessage(Handler.java:92)
01-20 18:33:47.229: E/AndroidRuntime(17468): at android.os.Looper.loop(Looper.java:137)
01-20 18:33:47.229: E/AndroidRuntime(17468): at android.app.ActivityThread.main(ActivityThread.java:4511)
01-20 18:33:47.229: E/AndroidRuntime(17468): at java.lang.reflect.Method.invokeNative(Native Method)
01-20 18:33:47.229: E/AndroidRuntime(17468): at java.lang.reflect.Method.invoke(Method.java:511)
01-20 18:33:47.229: E/AndroidRuntime(17468): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
01-20 18:33:47.229: E/AndroidRuntime(17468): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
01-20 18:33:47.229: E/AndroidRuntime(17468): at dalvik.system.NativeStart.main(Native Method)
01-20 18:36:41.642: I/Process(17468): Sending signal. PID: 17468 SIG: 9
01-20 18:36:42.092: I/OCVSample::Activity(17774): Instantiated new class org.opencv.samples.tutorial3.Sample3Native
01-20 18:36:42.092: I/OCVSample::Activity(17774): called onCreate
01-20 18:36:42.112: D/CameraBridge(17774): Attr count: 3
01-20 18:36:42.112: D/JavaCameraView(17774): Java camera view ctor
01-20 18:36:42.132: D/OpenCVManager/Helper(17774): Service connection created
01-20 18:36:42.132: D/OpenCVManager/Helper(17774): Trying to get library path
01-20 18:36:42.377: D/OpenCVManager/Helper(17774): Trying to get library list
01-20 18:36:42.612: D/OpenCVManager/Helper(17774): Library list: ""
01-20 18:36:42.612: D/OpenCVManager/Helper(17774): First attempt to load libs
01-20 18:36:42.612: D/OpenCVManager/Helper(17774): Trying to init OpenCV libs
01-20 18:36:42.612: D/OpenCVManager/Helper(17774): Trying to load library /data/data/org.opencv.engine/lib/libopencv_java.so
01-20 18:36:42.612: D/dalvikvm(17774): Trying to load lib /data/data/org.opencv.engine/lib/libopencv_java.so 0x4158d068
01-20 18:36:42.637: D/dalvikvm(17774): Added shared lib /data/data/org.opencv.engine/lib/libopencv_java.so 0x4158d068
01-20 18:36:42.637: D/OpenCVManager/Helper(17774): OpenCV libs init was ok!
01-20 18:36:42.637: D/OpenCVManager/Helper(17774): First attempt to load libs is OK
01-20 18:36:42.637: D/OpenCVManager/Helper(17774): Init finished with status 0
01-20 18:36:42.637: D/OpenCVManager/Helper(17774): Unbind from service
01-20 18:36:42.637: D/OpenCVManager/Helper(17774): Calling using callback
01-20 18:36:42.637: I/OCVSample::Activity(17774): OpenCV loaded successfully
01-20 18:36:42.637: D/AndroidRuntime(17774): Shutting down VM
01-20 18:36:42.637: W/dalvikvm(17774): threadid=1: thread exiting with uncaught exception (group=0x40c871f8)
01-20 18:36:42.642: E/AndroidRuntime(17774): FATAL EXCEPTION: main
01-20 18:36:42.642: E/AndroidRuntime(17774): java.lang.UnsatisfiedLinkError: Couldn't load native_sample: findLibrary returned null
01-20 18:36:42.642: E/AndroidRuntime(17774): at java.lang.Runtime.loadLibrary(Runtime.java:365)
01-20 18:36:42.642: E/AndroidRuntime(17774): at java.lang.System.loadLibrary(System.java:535)
01-20 18:36:42.642: E/AndroidRuntime(17774): at org.opencv.samples.tutorial3.Sample3Native$1.onManagerConnected(Sample3Native.java:33)
01-20 18:36:42.642: E/AndroidRuntime(17774): at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:314)
01-20 18:36:42.642: E/AndroidRuntime(17774): at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1068)
01-20 18:36:42.642: E/AndroidRuntime(17774): at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1085)
01-20 18:36:42.642: E/AndroidRuntime(17774): at android.os.Handler.handleCallback(Handler.java:605)
01-20 18:36:42.642: E/AndroidRuntime(17774): at android.os.Handler.dispatchMessage(Handler.java:92)
01-20 18:36:42.642: E/AndroidRuntime(17774): at android.os.Looper.loop(Looper.java:137)
01-20 18:36:42.642: E/AndroidRuntime(17774): at android.app.ActivityThread.main(ActivityThread.java:4511)
01-20 18:36:42.642: E/AndroidRuntime(17774): at java.lang.reflect.Method.invokeNative(Native Method)
01-20 18:36:42.642: E/AndroidRuntime(17774): at java.lang.reflect.Method.invoke(Method.java:511)
01-20 18:36:42.642: E/AndroidRuntime(17774): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
01-20 18:36:42.642: E/AndroidRuntime(17774): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
01-20 18:36:42.642: E/AndroidRuntime(17774): at dalvik.system.NativeStart.main(Native Method)
01-20 18:37:08.612: I/Process(17774): Sending signal. PID: 17774 SIG: 9
01-20 18:37:20.797: I/OCVSample::Activity(18138): Instantiated new class org.opencv.samples.tutorial3.Sample3Native
01-20 18:37:20.802: I/OCVSample::Activity(18138): called onCreate
01-20 18:37:20.812: D/CameraBridge(18138): Attr count: 3
01-20 18:37:20.812: D/JavaCameraView(18138): Java camera view ctor
01-20 18:37:20.827: D/OpenCVManager/Helper(18138): Service connection created
01-20 18:37:20.832: D/OpenCVManager/Helper(18138): Trying to get library path
01-20 18:37:21.057: D/OpenCVManager/Helper(18138): Trying to get library list
01-20 18:37:21.327: D/OpenCVManager/Helper(18138): Library list: ""
01-20 18:37:21.327: D/OpenCVManager/Helper(18138): First attempt to load libs
01-20 18:37:21.327: D/OpenCVManager/Helper(18138): Trying to init OpenCV libs
01-20 18:37:21.327: D/OpenCVManager/Helper(18138): Trying to load library /data/data/org.opencv.engine/lib/libopencv_java.so
01-20 18:37:21.327: D/dalvikvm(18138): Trying to load lib /data/data/org.opencv.engine/lib/libopencv_java.so 0x4158e028
01-20 18:37:21.342: D/dalvikvm(18138): Added shared lib /data/data/org.opencv.engine/lib/libopencv_java.so 0x4158e028
01-20 18:37:21.342: D/OpenCVManager/Helper(18138): OpenCV libs init was ok!
01-20 18:37:21.342: D/OpenCVManager/Helper(18138): First attempt to load libs is OK
01-20 18:37:21.342: D/OpenCVManager/Helper(18138): Init finished with status 0
01-20 18:37:21.342: D/OpenCVManager/Helper(18138): Unbind from service
01-20 18:37:21.342: D/OpenCVManager/Helper(18138): Calling using callback
01-20 18:37:21.342: I/OCVSample::Activity(18138): OpenCV loaded successfully
01-20 18:37:21.342: D/AndroidRuntime(18138): Shutting down VM
01-20 18:37:21.342: W/dalvikvm(18138): threadid=1: thread exiting with uncaught exception (group=0x40c871f8)
01-20 18:37:21.347: E/AndroidRuntime(18138): FATAL EXCEPTION: main
01-20 18:37:21.347: E/AndroidRuntime(18138): java.lang.UnsatisfiedLinkError: Couldn't load native_sample: findLibrary returned null
01-20 18:37:21.347: E/AndroidRuntime(18138): at java.lang.Runtime.loadLibrary(Runtime.java:365)
01-20 18:37:21.347: E/AndroidRuntime(18138): at java.lang.System.loadLibrary(System.java:535)
01-20 18:37:21.347: E/AndroidRuntime(18138): at org.opencv.samples.tutorial3.Sample3Native$1.onManagerConnected(Sample3Native.java:33)
01-20 18:37:21.347: E/AndroidRuntime(18138): at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:314)
01-20 18:37:21.347: E/AndroidRuntime(18138): at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1068)
01-20 18:37:21.347: E/AndroidRuntime(18138): at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1085)
01-20 18:37:21.347: E/AndroidRuntime(18138): at android.os.Handler.handleCallback(Handler.java:605)
01-20 18:37:21.347: E/AndroidRuntime(18138): at android.os.Handler.dispatchMessage(Handler.java:92)
01-20 18:37:21.347: E/AndroidRuntime(18138): at android.os.Looper.loop(Looper.java:137)
01-20 18:37:21.347: E/AndroidRuntime(18138): at android.app.ActivityThread.main(ActivityThread.java:4511)
01-20 18:37:21.347: E/AndroidRuntime(18138): at java.lang.reflect.Method.invokeNative(Native Method)
01-20 18:37:21.347: E/AndroidRuntime(18138): at java.lang.reflect.Method.invoke(Method.java:511)
01-20 18:37:21.347: E/AndroidRuntime(18138): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
01-20 18:37:21.347: E/AndroidRuntime(18138): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
01-20 18:37:21.347: E/AndroidRuntime(18138): at dalvik.system.NativeStart.main(Native Method)