Take the 2-minute tour ×

I had to build a library using ndk-build. Did that. it produced all the libXX.so files. It already had a apk file in the bin dir. Now how does this fit together. Should I be installing all the lib in the lib folder of my android phone and then install the apk and run it . Is this the way?

share|improve this question

1 Answer 1

Do you use a build system? Using Maven I used a local repository and put the .so files there (in appropriately named) directories, and then my build process picked them up when creating the apk. Let me know how you are building your apk and I might be able to help further.

Edited to include some Maven stuff

Dependency on a native library:


Using a local repository (where ${third-party-jars} is a path on your system e.g. <third-party-jars>/local/path/to/third/party/jars</third-party-jars>:

    <name>Third Party Closed Source Local Repository</name>
    <!-- Files must be in groupId/artifactId/version directories and named
         Example: ${groupId/$artifactId/$version/$artifactId-$version.$extension -->

The Maven build then just picks the so up as a dependency like it would a jar file etc.

share|improve this answer
I simply went into the project folder . it had a android.mk and application.mk in the jni folder. but the weird thing is it has the apk file in the bin. Never mind. I downloaded the android-ndk and simply did build-ndk in the project folder and it worked to create the libs. I will now just check the apk into the phone . Let me see if this works. –  sraddhaj Jul 31 '12 at 10:09
I didnt build the apk . I went to the application source dir and did ndk-build and it produced the lib files I didnt see it making the apk I guess. however this apk file is already present in the bin dir so I guess I need to link the apk to the shared libs it created on the build . How ? –  sraddhaj Jul 31 '12 at 10:57
I've done it with Maven... Edited my answer above so I can put some formatting in. –  krider2010 Jul 31 '12 at 11:10

Your Answer


