I downloaded opencv 2.4.3 to my ubuntu 12.04 and i tried to run the samples on my galaxy s II Adnroid 4.04. all the samples ran except ones using ndk.
I get this in console:
* Build of configuration Default for project OpenCV Tutorial 3 - Add Native OpenCV *
/home/icpavon/android-ndk-r8d/ndk-build /home/icpavon/android-ndk-r8d/ndk-build: 1: /home/icpavon/android-ndk-r8d/ndk-build: dirname: not found /home/icpavon/android-ndk-r8d/ndk-build: 86: /home/icpavon/android-ndk-r8d/ndk-build: uname: not found ERROR: Unknown host operating system:
* Build Finished *
and this is the logcat:
01-21 19:29:46.153: I/OCVSample::Activity(10322): Instantiated new class org.opencv.samples.tutorial3.Sample3Native 01-21 19:29:46.153: I/OCVSample::Activity(10322): called onCreate 01-21 19:29:46.163: D/CameraBridge(10322): Attr count: 3 01-21 19:29:46.168: D/JavaCameraView(10322): Java camera view ctor 01-21 19:29:46.178: D/OpenCVManager/Helper(10322): Service connection created 01-21 19:29:46.178: D/OpenCVManager/Helper(10322): Trying to get library path 01-21 19:29:46.438: D/OpenCVManager/Helper(10322): Trying to get library list 01-21 19:29:46.713: D/OpenCVManager/Helper(10322): Library list: "" 01-21 19:29:46.713: D/OpenCVManager/Helper(10322): First attempt to load libs 01-21 19:29:46.713: D/OpenCVManager/Helper(10322): Trying to init OpenCV libs 01-21 19:29:46.713: D/OpenCVManager/Helper(10322): Trying to load library /data/data/org.opencv.engine/lib/libopencv_java.so 01-21 19:29:46.713: D/dalvikvm(10322): Trying to load lib /data/data/org.opencv.engine/lib/libopencv_java.so 0x41543fa0 01-21 19:29:46.728: D/dalvikvm(10322): Added shared lib /data/data/org.opencv.engine/lib/libopencv_java.so 0x41543fa0 01-21 19:29:46.728: D/OpenCVManager/Helper(10322): OpenCV libs init was ok! 01-21 19:29:46.728: D/OpenCVManager/Helper(10322): First attempt to load libs is OK 01-21 19:29:46.728: D/OpenCVManager/Helper(10322): Init finished with status 0 01-21 19:30:41.783: I/Process(10414): Sending signal. PID: 10414 SIG: 9 01-21 19:35:37.018: I/Process(10708): Sending signal. PID: 10708 SIG: 9 01-21 19:35:44.698: I/OCVSample::Activity(11133): Instantiated new class org.opencv.samples.tutorial3.Sample3Native 01-21 19:35:44.698: I/OCVSample::Activity(11133): called onCreate 01-21 19:35:44.708: D/CameraBridge(11133): Attr count: 3 01-21 19:35:44.708: D/JavaCameraView(11133): Java camera view ctor 01-21 19:35:44.723: D/OpenCVManager/Helper(11133): Service connection created 01-21 19:35:44.723: D/OpenCVManager/Helper(11133): Trying to get library path 01-21 19:35:44.978: D/OpenCVManager/Helper(11133): Trying to get library list 01-21 19:35:45.208: D/OpenCVManager/Helper(11133): Library list: "" 01-21 19:35:45.208: D/OpenCVManager/Helper(11133): First attempt to load libs 01-21 19:35:45.208: D/OpenCVManager/Helper(11133): Trying to init OpenCV libs 01-21 19:35:45.208: D/OpenCVManager/Helper(11133): Trying to load library /data/data/org.opencv.engine/lib/libopencv_java.so 01-21 19:35:45.208: D/dalvikvm(11133): Trying to load lib /data/data/org.opencv.engine/lib/libopencv_java.so 0x4154a530 01-21 19:35:45.228: D/dalvikvm(11133): Added shared lib /data/data/org.opencv.engine/lib/libopencv_java.so 0x4154a530 01-21 19:35:45.228: D/OpenCVManager/Helper(11133): OpenCV libs init was ok! 01-21 19:35:45.228: D/OpenCVManager/Helper(11133): First attempt to load libs is OK 01-21 19:35:45.228: D/OpenCVManager/Helper(11133): Init finished with status 0 01-21 19:35:45.228: D/OpenCVManager/Helper(11133): Unbind from service 01-21 19:35:45.233: D/OpenCVManager/Helper(11133): Calling using callback 01-21 19:35:45.233: I/OCVSample::Activity(11133): OpenCV loaded successfully 01-21 19:35:45.233: D/AndroidRuntime(11133): Shutting down VM 01-21 19:35:45.233: W/dalvikvm(11133): threadid=1: thread exiting with uncaught exception (group=0x40c561f8) 01-21 19:35:45.238: E/AndroidRuntime(11133): FATAL EXCEPTION: main 01-21 19:35:45.238: E/AndroidRuntime(11133): java.lang.UnsatisfiedLinkError: Couldn't load native_sample: findLibrary returned null 01-21 19:35:45.238: E/AndroidRuntime(11133): at java.lang.Runtime.loadLibrary(Runtime.java:365) 01-21 19:35:45.238: E/AndroidRuntime(11133): at java.lang.System.loadLibrary(System.java:535) 01-21 19:35:45.238: E/AndroidRuntime(11133): at org.opencv.samples.tutorial3.Sample3Native$1.onManagerConnected(Sample3Native.java:33) 01-21 19:35:45.238: E/AndroidRuntime(11133): at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:314) 01-21 19:35:45.238: E/AndroidRuntime(11133): at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1068) 01-21 19:35:45.238: E/AndroidRuntime(11133): at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1085) 01-21 19:35:45.238: E/AndroidRuntime(11133): at android.os.Handler.handleCallback(Handler.java:605) 01-21 19:35:45.238: E/AndroidRuntime(11133): at android.os.Handler.dispatchMessage(Handler.java:92) 01-21 19:35:45.238: E/AndroidRuntime(11133): at android.os.Looper.loop(Looper.java:137) 01-21 19:35:45.238: E/AndroidRuntime(11133): at android.app.ActivityThread.main(ActivityThread.java:4511) 01-21 19:35:45.238: E/AndroidRuntime(11133): at java.lang.reflect.Method.invokeNative(Native Method) 01-21 19:35:45.238: E/AndroidRuntime(11133): at java.lang.reflect.Method.invoke(Method.java:511) 01-21 19:35:45.238: E/AndroidRuntime(11133): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980) 01-21 19:35:45.238: E/AndroidRuntime(11133): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747) 01-21 19:35:45.238: E/AndroidRuntime(11133): at dalvik.system.NativeStart.main(Native Method)
please don't send me to google i tried every solution there is. i also saw the question here and i didn't really understand the answer.
thanks!