Closed carlosandre-br closed 3 years ago
There are similar issues created for UnsatisfiedLinkError
recently. Have you looked at them?
Yes I did, but none of them referred to the problem with dynamic delivery specifically. I solved it by loading the libraries using SplitInstallHelper.loadLibrary(Context,String) after module installation. This way:
@Override
public void onStateUpdate(SplitInstallSessionState state) {
if (state.sessionId() == sessionId) {
switch (state.status()) {
case INSTALLED:
statusText.setText("Installed - Feature is ready");
SplitInstallHelper.loadLibrary(this, "avutil");
SplitInstallHelper.loadLibrary(this, "swscale");
SplitInstallHelper.loadLibrary(this, "swresample");
SplitInstallHelper.loadLibrary(this, "avcodec");
SplitInstallHelper.loadLibrary(this, "avformat");
SplitInstallHelper.loadLibrary(this, "avfilter");
SplitInstallHelper.loadLibrary(this, "avdevice");
break;
}
}
}
Thank you!
@carlosandre-br Thanks for the answer
i am getting "java.lang.UnsatisfiedLinkError: dlopen failed: library "libavfilter.so" not found"
@carlosandre-br I tried your code but it's not working for me!
does FakeSplitInstallManagerFactory is necessary if you testing a dynamic feature module locally?
Version mobile-ffmpeg-audio - 4.4.LTS
Hello @iamkdblue!
It's not necessary to use FakeSplitInstallManagerFactory to test success cases.
I'm attaching a demo project that's working, please check DynamicDemo.zip and compare with yours.
@carlosandre-br finally it solved now, Thank you so much, your project helps me a lot. You should put the above project on GitHub, it will help many people
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Description The library works perfectly in my environment, but when I try to run it on a dynamic module, I'm getting java.lang.UnsatisfiedLinkError: dlopen failed: library "libavfilter.so" not found.
Expected behavior Run the library in a dynamic feature module.
Current behavior The library crashes when it calls System.loadLibrary("mobileffmpeg");
Logs https://ghostbin.co/paste/9o4rt
Environment
Other In Debug mode the app works fine.
But when I installed as App Bundle, I got the error.
Steps I did:
sudo java -jar bundletool-all-1.4.0.jar build-apks --local-testing --bundle /path/to/app-release.aab --output /path/to/output.apks
sudo java -jar bundletool-all-1.4.0.jar install-apks --apks /path/to/output.apks
Additional Log after the module installation: https://ghostbin.co/paste/7rsj2