KeepSafe/ReLinker

ReLinker still fixes issues on API 23 (Documentation bug?)

chenposun opened this issue ยท 8 comments

Just noticed in the latest documentation you mention

If your app includes native libraries, and your minimum SDK is below API 23 (Marshmallow), you need ReLinker.

We are finding that we get java.lang.UnsatisfiedLinkError even on Marshmallow, and ReLinker fixes the issue.

Should the documentation perhaps be your minimum SDK is API 23 *and* below?

Thanks, that's really interesting! My contacts on the Android team believe that all of the known library-loading bugs were fixed with the release of Marshmallow, so this would seem to be a new bug - or rather, new to them.

Happy to take a PR to update the docs!

Hi people, we see native library errors even on android P:

Caused by java.lang.UnsatisfiedLinkError
dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/app.my-hlN2YEi3GGzz9UjgdZx4dA==/base.apk"],nativeLibraryDirectories=[/data/app.my-hlN2YEi3GGzz9UjgdZx4dA==/lib/x86, /system/lib]]] couldn't find "libobjectbox-jni.so"

Our min sdk is 23.

Do you think that usage of relinker will help?

Maybe? Give it a try and let us know.

I'm sorry to hear that this continues to be an issue, even on P.

We (Android) don't know of any issues that would require ReLinker on OS versions that new. An app- or device-specific bug seems likely, but if you file a bug with a repro case we can help figure that out.

@benjamin-bader sorry for pocking you again. We have a library dependency that tries to load native library. If we load upfront with ReLinker this library, will it be picked up later by library dependency load request?

@DanAlbert I will file the ticket tomorrow, sorry for the delay.

I'm also seeing UnsatisfiedLinkError issues for Android P users in the wild. But <1% of users are affected, and unfortunately I haven't been able to reproduce locally.

Obviously it's a platform issue but without a way to reproduce I guess we're stuck. Is there a chance ReLinker will help with unknown bugs simply because it does things a little differently? I'll give it a try, I guess.

@brianguertin I have only seen the bug once in my entire Android dev career at Keepsafe and was never to reproduce it.
The best thing you can do it try using ReLinker and just look at your error logs or analytics. Would be great if you could just keep this thread updated with what you see.