Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Android native libs loading on apps deployed with 'mobile-install' #15361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oliviernotteghem
Copy link

Fixes #13661 by specifying the full list of (parent) native libs location in Bazel's IncrementalClassLoader.

StubApplication (used by Bazel 'mobile-install') fails to load native library defined in incremental APK. Issue is fixed by specifying the full set of native libs pathes (obtained via reflection from parent classloader) directly into IncrementalClassLoader, so that classloader doesn't have to iterate through its parent chain to find the native library. Iterating through parent (which is what #14965 does - thank you to @Bencodes for this and the inspiration for the fix works in most cases, however it doesn't handled cases where native libs needs to load other native lids. In this case, dlopen() will fail since it can only look into IncrementalClassLoader() native libs path, and not parents.

This will crashes for instances with Android applications using flipper when they're deployed via 'mobile-install', in addition to any app that relies on native libs deployed that way.

@Bencodes
Copy link
Contributor

cc: @ahumesky @ted-xie

@sgowroji sgowroji added team-Android Issues for Android team awaiting-review PR is awaiting review from an assigned reviewer labels Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-Android Issues for Android team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mobile install fails to load native libraries provided by AARs
3 participants