6 comments

Top
鹏 杜.'s picture

i run javah -d jni -classpath ...... comand , and it has generate head file.

then I add the ndk path to local.properties, and then run build-.make project, whye my project does not generate so file at ndk folder ?

my email:4909004@qq.com

 

鹏 杜.'s picture

I do not know why, I delete old project and build a new project then it run as well

Piyush G.'s picture

I have followed the same steps and I have all the required .c/.h files inside the jni folder.  I have also updated the ndk path in local.properties.. but Android studio is still not attempting to build the .so file.

is there some configuration i need to change to ask it to start building C/C++ code inside jni folder ?

 

Matthew G.'s picture

This is a very useful video. However, I have not been able to figure out how to include the ndk libraries. Specifically, I can include <android/log.h> and the constants from that file are found, but the function definitions are not. I'm guessing I need to be configure gradle somehow, but I have not been able to find instructions anywhere. Do you know how to do this?

Matthew G.'s picture

My question was actually answered at 10:04. I should have watched till the end :/

rash b.'s picture

I am getting the following error on running the project and I feel that it is because my .so files are not getting generated. Why are my .so files not generated? My email is bindalprashast@gmail.com

02-17 15:54:43.499: E/AndroidRuntime(13387): Process: com.pcvlab.glasslocalization, PID: 13387
02-17 15:54:43.499: E/AndroidRuntime(13387): java.lang.UnsatisfiedLinkError: Couldn't load pcv_glass_localization from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.pcvlab.glasslocalization-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.pcvlab.glasslocalization-1, /vendor/lib, /system/lib]]]: findLibrary returned null
02-17 15:54:43.499: E/AndroidRuntime(13387):     at java.lang.Runtime.loadLibrary(Runtime.java:358)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at java.lang.System.loadLibrary(System.java:526)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at com.pcvlab.glasslocalization.MainActivity$1.onManagerConnected(MainActivity.java:63)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:318)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1114)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1131)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at android.os.Handler.handleCallback(Handler.java:733)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at android.os.Handler.dispatchMessage(Handler.java:95)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at android.os.Looper.loop(Looper.java:146)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at android.app.ActivityThread.main(ActivityThread.java:5602)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at java.lang.reflect.Method.invokeNative(Native Method)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at java.lang.reflect.Method.invoke(Method.java:515)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
02-17 15:54:43.499: E/AndroidRuntime(13387):     at dalvik.system.NativeStart.main(Native Method)
02-17 15:54:45.181: I/Process(13387): Sending signal. PID: 13387 SIG: 9

 

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.