Android Native Libraries Packaging

less than 1 minute read

In this post we will discuss my insights/observations on packaging native libraries in an Android apk.

According to Google developer blog it is better to package all the required native libraries as part of apk because of concept of namespaces introduced. This namespace will prevent user apps from accessing system libraries other than android ndk native libraries. This is introduced to reduce app crashes/incompatability/symbol conflicts with other libraries in different devices.

But there is a way to package dependent native libraries with Adding additional native libraries which needs vendors to ship their own Android image.

So, in a nutshell by default all ndk native libraries, libraries part of apk are accessible.

In next post, I will be discussing about ways I found to reduce shared library/Native Code size.

References:

[1] Namespaces for Native Libraries
[2] Improving Stability with Private C/C++ Symbol Restrictions in Android N

Updated:

Leave a comment