Link in Android Studio with shared libraries with versioning

Viewed 204

I am working on an Android application that uses external libraries (written in C++ with a Java wrapper generated with SWIG). My problem is that one of the shared libraries depends on another shared library that uses versioning, e.g. libicui18n.so.67. Android Studio copies in the application bundle only *.so libs, ignoring the libraries that don't end in .so (these are actually symbolic link containing the version in the so name).

My question is how do I copy also these symbolic links in the application bundle or libraries that contain the version number in their name ?

1 Answers

My final solution to this problem was to compile only one shared library, while all other external dependences were static libraries.

An alternative solution would be to use patchelf https://github.com/NixOS/patchelf in order to modify the shared libraries (by changing soname and need fields) so that only shared libraries ending in .so are used.

Related