-
Notifications
You must be signed in to change notification settings - Fork 176
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
Can't load libraries that are in dynamic feature modules #19
Comments
I think this might also be related to an issue I am having with Fresco and AppBundles |
Thanks so much! |
@DSteve595 How did you resolve the issue? |
It was resolved by #26. |
So you are using the patched So loader from @nesterov-n? Because the fix wasn't merged as I see it. |
It was merged. See c7980fc |
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 |
I found that the error is actually not that the files are in a different place, but that |
I met same problem, when apply dynamic module using React Native activity :( |
@bembem1011 do you have the same problem that |
I haven't found the rootcause yet, but if you can share it with me, �I want to try out :( thanks you very much |
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 dependencies {
...
implementation ('com.facebook.react:react-native:+') {
exclude group: 'com.facebook.soloader', module: 'soloader'
}
implementation name: 'soloader', ext: 'aar'
}
repositories {
flatDir {
dirs 'libs'
}
} |
thanks @erksch today I will try your patch |
thanks @erksch you save my life. Your patch is work well, however I haven't understood deeply yet. When I read the debug log, I see splitResourceDirs is not null. However, the soloader cannot load the library correctly without your patch. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
&& context.getApplicationInfo().splitSourceDirs != null) {
Log.d(TAG, "adding backup sources from split apks");
int splitIndex = 0;
for (String splitApkDir : context.getApplicationInfo().splitSourceDirs) {
ApkSoSource splitApkSource =
new ApkSoSource(
context,
new File(splitApkDir),
SO_STORE_NAME_SPLIT + (splitIndex++),
apkSoSourceFlags);
Log.d(TAG, "adding backup source: " + splitApkSource.toString());
backupSources.add(splitApkSource);
}
}
|
@erksch @bembem1011 might be a silly request but can you share soloader.aar file? I am facing the same issue and want to try this solution. |
@erksch this should be incorporated on the main SoLoader, I don't feel the current version can handle "splitcompat" folders given the amount of issues the community have, just search for "android app bundles java.lang.UnsatisfiedLinkError: couldn't find DSO to load" and most people will be stuck in the same problem. |
@erksch Thanks much for this patch, we were facing the same issue and it did its magic 👍 |
@fcduarte @belemaire I'm glad my patch worked for you. I can open a PR, but I think my addition is kind of hacky and maybe needs some polishing before going into the main branch. My fix worked for my problem and has some assumptions where the files will be without actually knowing why, but seeing that it solves the problem for multiple people I'll open a PR. |
I'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 thanSystem.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 myloadLibrary()
never gets called.The text was updated successfully, but these errors were encountered: