I am making an Android application using NDK. One of the shared libraries that I use depends on the ICU, which is another library that I am also trying to explicitly include.
The problem is that my device (as many others seem to have) has an old version of ICU pre-installed. This means that whenever I try to download my shared library, the system tries to download the system version instead of my own newer version.
Android seems to ignore any RPATH that would otherwise allow libraries to determine where to look for dependencies. As far as I understand, RPATH is essentially hardcoded for /vendor/liband /system/libon Android.
I saw several workarounds for this problem, but none of them work:
- Explicitly load all libraries (including dependencies) in the order of dependency.
Despite the fact that ICU libraries load in order (via their absolute paths), I still get an error cannot locate symbolwhen trying to load my shared library. I checked four times (via nmand readelf) that the missing character exists in my (recently compiled) ICU files .so.
- Change
SONAMEdynamic ICU libraries to something specific to the project and depend on them.
This may work, but is the final result because it will require recompiling a lot of library code with non-trivial dependencies. It also looks more like a hack. Simply changing the name of the libraries does not work for the same reason as 1. - although ICU characters are loaded, they are not recognized when the dependent library tries to access them.
My question is who has tried something like this before or knows his path, connected a little more than me: how did you work it? Is there a way to get Android to get its notorious hotsauce together and actually load the correct libraries or use other characters that I have already successfully downloaded?