tanersener / mobile-ffmpeg

FFmpeg for Android, iOS and tvOS. Not maintained anymore. Superseded by FFmpegKit.
https://tanersener.github.io/mobile-ffmpeg
GNU General Public License v3.0
3.85k stars 787 forks source link

java.lang.UnsatisfiedLinkError couldn't find libmobileffmpeg_abidetect.so, crashing on 4.4.LTS #642

Closed vlad-roid closed 3 years ago

vlad-roid commented 3 years ago

Description Seeing this crash on Play Store/Crashlytics, happening all the time, but only for less than 1% of users. Haven't seen it before updating to 4.4.LTS. Before you dismiss this as a duplicate: The crash DOES NOT happen for anyone else, only these few users, which means FFmpeg is built and included via Gradle correctly. And just to clarify, quoting @tanersener here:

Similar issues were reported before. All of them were resolved by rebuilding the application, cleaning the cache, etc. I'll recommend trying similar things.

libmobileffmpeg-abidetect.so is included in all .aar archives published by mobile-ffmpeg. If you're not manually excluding it in your gradle files, then it should copied to your apk as well. You can check it yourself by using Build -> Analyze APK menu of Android Studio.

I already did all of it every time before releasing each my app versions.

Expected behavior The app should not crash and AbiDetect should load fine, or at least the error should be caught without crashing.

Current behavior The app crashes at loadLibrary here:

public class AbiDetect {

    static {
        armV7aNeonLoaded = false;

        System.loadLibrary("mobileffmpeg_abidetect");

        /* ALL LIBRARIES LOADED AT STARTUP */
        Config.class.getName();
        FFmpeg.class.getName();
    }

    ....

Logs

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/[...]==/base.apk"],nativeLibraryDirectories=[/data/app/[...]==/lib/arm, /system/lib, /system/vendor/lib]]] couldn't find "libmobileffmpeg_abidetect.so"
  at java.lang.Runtime.loadLibrary0 (Runtime.java:1011)
  at java.lang.System.loadLibrary (System.java:1657)
  at com.arthenica.mobileffmpeg.AbiDetect.<clinit> (AbiDetect.java:33)
  at com.arthenica.mobileffmpeg.AbiDetect.getNativeAbi (AbiDetect.java)
  at com.arthenica.mobileffmpeg.Config.<clinit> (Config.java:131)
  at com.arthenica.mobileffmpeg.Config.enableLogCallback (Config.java:220)

Environment Good mix of devices:

Vnicius commented 3 years ago

I'm having the same issue. Even after the workaround of #616

tanersener commented 3 years ago

@Vnicius My instructions to investigate this issue is given in the first post. I suggest trying them and checking whether libmobileffmpeg-abidetect.so is packaged for the ABIs your application supports.

The message printed is clear, couldn't find "libmobileffmpeg_abidetect.so". If there isn't another exception/error before, this error message tells that libmobileffmpeg_abidetect.so does not exist.

Different reasons can cause this. It is hard to tell more without knowing the following information.

  1. Device API Level - Users may try to run your app on API Levels mobile-ffmpeg doesn't support
  2. Device ABI - Users may try to run your app on ABIs mobile-ffmpeg doesn't support
  3. ABIs packaged by the app - Maybe some ABIs are excluded during the packaging of your application
  4. Device brand & model - There are a lot of Android manufacturers. I know that some of them don't follow the guidelines provided by Android use custom solutions. Maybe the way mobile-ffmpeg is loaded doesn't work on those custom implementations.

If you can reproduce the issue locally, you can find the answers of these questions and find a solution. But from my perspective, unfortunately I don't have enough information to make a comment.

github-actions[bot] commented 3 years ago

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.

tanersener commented 3 years ago

This project will be retired. Please consider switching to FFmpegKit.