KeepSafe/ReLinker

MissingLibraryException when using Android App Bundle

Closed this issue ยท 4 comments

@Jeff11 thanks for reporting this. This seems to be a legitimate issue. When we build ReLinker, AppBundles were not a thing and we don't use them until today.

The comment in the google issue sums it up quite well:

ReLinker loads the native library directly from the APK file, without using the OS' System.load() or System.loadLibrary() methods. The issue is that it searches for the native libraries in the base APK, whereas with the App Bundle, the native libraries are in config splits (i.e. ReLinker searches in base.apk whereas the native libraries are actually in base-x86.apk, base-armeabi.apk, etc.).

Source:
https://github.com/KeepSafe/ReLinker/blob/master/relinker/src/main/java/com/getkeepsafe/relinker/ApkLibraryInstaller.java#L55
Instead of searching in "sourceDir", ReLinker should be searching over the different directories under "splitSourceDirs".

@Jeff11 @chriswiesner Does anyone has the capacity to open a PR for this?

Hi, I was hit by the same bug. I have a version that uses splitSourceDirs in addition to sourceDir here: https://github.com/michalsrb/ReLinker/tree/splitapks

I am testing it at the moment. If it works I'll open pull request.

Request opened (see above). Testing shown that on some devices the splitSourceDirs gives null, so that had to be checked. I am currently rolling my app out to production with that version and so far all looks good.