Can't load libraries that are in dynamic feature modules
See original GitHub issueI’m trying to include a React Native activity in a dynamic feature module. It works when it’s included in the base APK, but it looks like some hackery is needed when loading native libraries that are in an installed dynamic feature module: SplitInstallHelper.loadLibrary()
should be used on 26+ rather than System.loadLibrary()
. Currently I’m getting a crash saying the native library couldn’t be found, and this seems like the most likely culprit.
Since SoLoader is the one making the actual call, I’m not sure how I could do that from my end. I tried using sSystemLoadLibraryWrapper
, but it looks like my loadLibrary()
never gets called.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:19
Top Results From Across the Web
Third party library of dynamic feature module cannot access ...
Currently you can access Dynamic Module via reflection and having dynamic features defined through public interfaces in a common library ...
Read more >Using native library inside dynamic feature module: Part 1
We will create a new project which contains an app module and add a dynamic feature module. Both of these modules contain activities...
Read more >Unable to install dynamic feature module after clearing app data
Go to app and install modules common and feature1 in a single session request. OK . · Install module feature2 . · Clear...
Read more >Navigate with feature modules - Android Developers
When you navigate to one of these destinations, the Dynamic Navigator library first checks if the feature module is installed. If the feature ......
Read more >Reusing Dynamic Feature Modules (DFM)
Note: running the app directly from Android Studio will not show “downloading module” screen. You have to use internal app sharing to test...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can use my fork of SoLoader on the develop branch, build it and include the AAR in your project and see if it works.
Should be something like
Weird, it doesn’t work for me. The SoLoader does not find the native libraries:
The native libraries are actually located in
But the SoLoader does not seem to pick up this path. I wonder why it would work for you if your libs are in the same location.
I guess this is where
SplitInstallHelper.loadLibrary()
would search for.