ReLinker icon indicating copy to clipboard operation
ReLinker copied to clipboard

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

Open chenposun opened this issue 5 years ago • 8 comments
trafficstars

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?

chenposun avatar Mar 10 '20 01:03 chenposun

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!

benjamin-bader avatar Mar 10 '20 03:03 benjamin-bader

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?

emartynov avatar Jul 09 '20 10:07 emartynov

Maybe? Give it a try and let us know.

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

benjamin-bader avatar Jul 09 '20 20:07 benjamin-bader

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.

DanAlbert avatar Jul 10 '20 00:07 DanAlbert

@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?

emartynov avatar Jul 13 '20 20:07 emartynov

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

emartynov avatar Jul 13 '20 20:07 emartynov

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 avatar Jul 16 '20 12:07 brianguertin

@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.

philippb avatar Jul 06 '21 23:07 philippb