Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Building native samples

So I was able to run all samples exept ones using ndk.

I get this in console `

**** Build of configuration Default for project OpenCV Tutorial 3 - Add Native OpenCV ****

D:\pbIxtex\android-ndk-r7c-windows\android-ndk-r7c\ndk-build.cmd 
Install        : libnative_sample.so => libs/armeabi-v7a/libnative_sample.so


**** Build Finished ****

and this is the logcat

10-26 21:28:44.994: E/AndroidRuntime(9469): FATAL EXCEPTION: main
10-26 21:28:44.994: E/AndroidRuntime(9469): java.lang.UnsatisfiedLinkError: Couldn't load native_sample: findLibrary returned null
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.Runtime.loadLibrary(Runtime.java:429)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.System.loadLibrary(System.java:554)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at org.opencv.samples.tutorial3.Sample3Native$1.onManagerConnected(Sample3Native.java:27)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:206)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1064)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1081)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Handler.handleCallback(Handler.java:587)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Handler.dispatchMessage(Handler.java:92)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Looper.loop(Looper.java:130)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.ActivityThread.main(ActivityThread.java:3835)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.reflect.Method.invokeNative(Native Method)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.reflect.Method.invoke(Method.java:507)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at dalvik.system.NativeStart.main(Native Method)

if i try ndk-build.cmd -B it goes like this

**** Build of configuration Default for project OpenCV Tutorial 3 - Add Native OpenCV ****

D:\pbIxtex\android-ndk-r7c-windows\android-ndk-r7c\ndk-build.cmd -B 
"Compile++ thumb : native_sample <= jni_part.cpp

Prebuilt       : libgnustl_static.a <= <NDK>/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/

SharedLibrary  : libnative_sample.so

Install        : libnative_sample.so => libs/armeabi-v7a/libnative_sample.so


**** Build Finished ****

but the error is the same. I've tried CDT 8.1.0 and 8.0.2 and ndk r8b and r7c.

I've downloaded the samples from google play and they worked. Any suggestions?

Building native samplessamples problem

So I was able to run all samples exept ones using ndk.

I get this in console `

**** Build of configuration Default for project OpenCV Tutorial 3 - Add Native OpenCV ****

D:\pbIxtex\android-ndk-r7c-windows\android-ndk-r7c\ndk-build.cmd 
Install        : libnative_sample.so => libs/armeabi-v7a/libnative_sample.so


**** Build Finished ****

and this is the logcat

10-26 21:28:44.994: E/AndroidRuntime(9469): FATAL EXCEPTION: main
10-26 21:28:44.994: E/AndroidRuntime(9469): java.lang.UnsatisfiedLinkError: Couldn't load native_sample: findLibrary returned null
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.Runtime.loadLibrary(Runtime.java:429)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.System.loadLibrary(System.java:554)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at org.opencv.samples.tutorial3.Sample3Native$1.onManagerConnected(Sample3Native.java:27)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:206)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1064)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1081)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Handler.handleCallback(Handler.java:587)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Handler.dispatchMessage(Handler.java:92)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Looper.loop(Looper.java:130)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.ActivityThread.main(ActivityThread.java:3835)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.reflect.Method.invokeNative(Native Method)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.reflect.Method.invoke(Method.java:507)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at dalvik.system.NativeStart.main(Native Method)

if i try ndk-build.cmd -B it goes like this

**** Build of configuration Default for project OpenCV Tutorial 3 - Add Native OpenCV ****

D:\pbIxtex\android-ndk-r7c-windows\android-ndk-r7c\ndk-build.cmd -B 
"Compile++ thumb : native_sample <= jni_part.cpp

Prebuilt       : libgnustl_static.a <= <NDK>/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/

SharedLibrary  : libnative_sample.so

Install        : libnative_sample.so => libs/armeabi-v7a/libnative_sample.so


**** Build Finished ****

but the error is the same. I've tried CDT 8.1.0 and 8.0.2 and ndk r8b and r7c.

I've downloaded the samples from google play and they worked. Any suggestions?

Building native samples problemCouldn't load native_sample: findLibrary returned null

So I was able to run all samples exept except ones using ndk.

I get this in console `

**** Build of configuration Default for project OpenCV Tutorial 3 - Add Native OpenCV ****

D:\pbIxtex\android-ndk-r7c-windows\android-ndk-r7c\ndk-build.cmd 
Install        : libnative_sample.so => libs/armeabi-v7a/libnative_sample.so


**** Build Finished ****

and this is the logcat

10-26 21:28:44.994: E/AndroidRuntime(9469): FATAL EXCEPTION: main
10-26 21:28:44.994: E/AndroidRuntime(9469): java.lang.UnsatisfiedLinkError: Couldn't load native_sample: findLibrary returned null
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.Runtime.loadLibrary(Runtime.java:429)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.System.loadLibrary(System.java:554)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at org.opencv.samples.tutorial3.Sample3Native$1.onManagerConnected(Sample3Native.java:27)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:206)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1064)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1081)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Handler.handleCallback(Handler.java:587)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Handler.dispatchMessage(Handler.java:92)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Looper.loop(Looper.java:130)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.ActivityThread.main(ActivityThread.java:3835)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.reflect.Method.invokeNative(Native Method)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.reflect.Method.invoke(Method.java:507)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at dalvik.system.NativeStart.main(Native Method)

if i try ndk-build.cmd -B it goes like this

**** Build of configuration Default for project OpenCV Tutorial 3 - Add Native OpenCV ****

D:\pbIxtex\android-ndk-r7c-windows\android-ndk-r7c\ndk-build.cmd -B 
"Compile++ thumb : native_sample <= jni_part.cpp

Prebuilt       : libgnustl_static.a <= <NDK>/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/

SharedLibrary  : libnative_sample.so

Install        : libnative_sample.so => libs/armeabi-v7a/libnative_sample.so


**** Build Finished ****

but the error is the same. I've tried CDT 8.1.0 and 8.0.2 and ndk r8b and r7c.

I've downloaded the samples from google play and they worked. Any suggestions?

Couldn't load native_sample: findLibrary returned null

So I was able to run all Android samples except ones using ndk.

I get this in console `

**** Build of configuration Default for project OpenCV Tutorial 3 - Add Native OpenCV ****

D:\pbIxtex\android-ndk-r7c-windows\android-ndk-r7c\ndk-build.cmd 
Install        : libnative_sample.so => libs/armeabi-v7a/libnative_sample.so


**** Build Finished ****

and this is the logcat

10-26 21:28:44.994: E/AndroidRuntime(9469): FATAL EXCEPTION: main
10-26 21:28:44.994: E/AndroidRuntime(9469): java.lang.UnsatisfiedLinkError: Couldn't load native_sample: findLibrary returned null
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.Runtime.loadLibrary(Runtime.java:429)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.System.loadLibrary(System.java:554)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at org.opencv.samples.tutorial3.Sample3Native$1.onManagerConnected(Sample3Native.java:27)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:206)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1064)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1081)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Handler.handleCallback(Handler.java:587)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Handler.dispatchMessage(Handler.java:92)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Looper.loop(Looper.java:130)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.ActivityThread.main(ActivityThread.java:3835)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.reflect.Method.invokeNative(Native Method)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.reflect.Method.invoke(Method.java:507)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at dalvik.system.NativeStart.main(Native Method)

if i try ndk-build.cmd -B it goes like this

**** Build of configuration Default for project OpenCV Tutorial 3 - Add Native OpenCV ****

D:\pbIxtex\android-ndk-r7c-windows\android-ndk-r7c\ndk-build.cmd -B 
"Compile++ thumb : native_sample <= jni_part.cpp

Prebuilt       : libgnustl_static.a <= <NDK>/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/

SharedLibrary  : libnative_sample.so

Install        : libnative_sample.so => libs/armeabi-v7a/libnative_sample.so


**** Build Finished ****

but the error is the same. I've tried CDT 8.1.0 and 8.0.2 and ndk r8b and r7c.

I've downloaded the samples from google play and they worked. Any suggestions?

Couldn't load native_sample: findLibrary returned nullnull opencv4android

So I was able to run all Android samples except ones using ndk.

I get this in console `

**** Build of configuration Default for project OpenCV Tutorial 3 - Add Native OpenCV ****

D:\pbIxtex\android-ndk-r7c-windows\android-ndk-r7c\ndk-build.cmd 
Install        : libnative_sample.so => libs/armeabi-v7a/libnative_sample.so


**** Build Finished ****

and this is the logcat

10-26 21:28:44.994: E/AndroidRuntime(9469): FATAL EXCEPTION: main
10-26 21:28:44.994: E/AndroidRuntime(9469): java.lang.UnsatisfiedLinkError: Couldn't load native_sample: findLibrary returned null
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.Runtime.loadLibrary(Runtime.java:429)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.System.loadLibrary(System.java:554)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at org.opencv.samples.tutorial3.Sample3Native$1.onManagerConnected(Sample3Native.java:27)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:206)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1064)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1081)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Handler.handleCallback(Handler.java:587)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Handler.dispatchMessage(Handler.java:92)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.os.Looper.loop(Looper.java:130)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at android.app.ActivityThread.main(ActivityThread.java:3835)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.reflect.Method.invokeNative(Native Method)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at java.lang.reflect.Method.invoke(Method.java:507)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
10-26 21:28:44.994: E/AndroidRuntime(9469):     at dalvik.system.NativeStart.main(Native Method)

if i try ndk-build.cmd -B it goes like this

**** Build of configuration Default for project OpenCV Tutorial 3 - Add Native OpenCV ****

D:\pbIxtex\android-ndk-r7c-windows\android-ndk-r7c\ndk-build.cmd -B 
"Compile++ thumb : native_sample <= jni_part.cpp

Prebuilt       : libgnustl_static.a <= <NDK>/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/

SharedLibrary  : libnative_sample.so

Install        : libnative_sample.so => libs/armeabi-v7a/libnative_sample.so


**** Build Finished ****

but the error is the same. I've tried CDT 8.1.0 and 8.0.2 and ndk r8b and r7c.

I've downloaded the samples from google play and they worked. Any suggestions?