Android native lib not installed with APK

I created an android library project that uses some native libraries.

I created a jni wrapper and put my own libs (.so) in the libs // folders. Native libraries compiled using cmake for armeabi, armeabi-v7a, x86 and mips.

I will export this project to a jar and put this jar in an “ordinary” android project. Then I export this project to apk and see that my libraries are linked to it.

However, when I install apk, the libs corresponding to the device are not copied to /data/data/com.my.app/lib, and, obviously, when starting the application they complain that you did not find libs (UnsatisfiedLinkError).

I look through SO and wherever I can, but have not found the answer that resolved my case.

I am using Eclipse, btw

thanks for the help

UPDATE

OK, I read the document in ndk and saw examples, and, unfortunately, I do not see the solution.

ndk builds c code in shared libraries and puts them in a dedicated place in the project. But it does not generate anything, which suggests that libs should be installed with apk.

My goal is to provide an android library (like a jar) that can be included in an Android application. I do not see the real difference between what I do (compile with libs with cmake and pack the jni and java compiled classes into a jar) and what is done with android.mk

If you see what I am missing, feel free to tell me (even if it is obvious).

thanks

UPDATE

: libs jar, , .so . Suprise, libs /data/data/com.me.myapp/lib

, .

+4
2

"" . apk , libs .

, Android JAR. .so, , " Android": enter image description here

+1

ndk-build?

. .

http://developer.android.com/tools/sdk/ndk/index.html

, /samples//, ndk-build. /samples//libs/armeabi/for ( ARMv5TE) //samples//libs/armeabi-v7a/for ( ARMv7).

0

All Articles