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

FFmpegKit failed to start on brand samsung: libffmpegkit_abidetect.so not found #941

Open
jackyhieu1211 opened this issue Mar 1, 2024 · 10 comments
Labels
android Affect Android platform library Affects the library not-reproducible v6.0

Comments

@jackyhieu1211
Copy link

jackyhieu1211 commented Mar 1, 2024

Hi admin
I use FFmpegKit android version 6.0.2.

Bug on device android 13 and android 14:

Galaxy A53 5G
Galaxy A34 5G
Galaxy A13
Oppo Reno7/F21 Pro

Fatal Exception: java.lang.Error: FFmpegKit failed to start on brand: samsung, model: SM-A137F, device: a13ve, api level: 33, abis: armeabi-v7a armeabi, 32bit abis: armeabi-v7a armeabi, 64bit abis: .
       at com.arthenica.ffmpegkit.NativeLoader.loadLibrary(NativeLoader.java:50)
       at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKitAbiDetect(NativeLoader.java:130)
       at com.arthenica.ffmpegkit.AbiDetect.<clinit>(AbiDetect.java:30)
       at com.arthenica.ffmpegkit.NativeLoader.loadNativeAbi(NativeLoader.java:65)
       at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKit(NativeLoader.java:173)
       at com.arthenica.ffmpegkit.FFmpegKitConfig.<clinit>(FFmpegKitConfig.java:145)
Caused by java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/app/~~5lam1Xupt7J2ylicEoCLZg==/my.package.name-Jy5XcDQ5FSw-hQSFkDWY_g==/split_config.armeabi_v7a.apk!/lib/armeabi-v7a/libffmpegkit_abidetect.so" not found
       at java.lang.Runtime.loadLibrary0(Runtime.java:1082)
       at java.lang.Runtime.loadLibrary0(Runtime.java:1003)
       at java.lang.System.loadLibrary(System.java:1661)
       at com.arthenica.ffmpegkit.NativeLoader.loadLibrary(NativeLoader.java:48)
       at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKitAbiDetect(NativeLoader.java:130)
       at com.arthenica.ffmpegkit.AbiDetect.<clinit>(AbiDetect.java:30)
       at com.arthenica.ffmpegkit.NativeLoader.loadNativeAbi(NativeLoader.java:65)
       at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKit(NativeLoader.java:173)
       at com.arthenica.ffmpegkit.FFmpegKitConfig.<clinit>(FFmpegKitConfig.java:145)

my build.gradle

android {
    namespace 'my.package.name'
    compileSdk 34
    ndkVersion "22.1.7171670"
    defaultConfig {
        applicationId "my.package.name"
        minSdk 24
        targetSdk 34
        versionCode 25
        versionName "1.25"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }


///

  implementation 'com.arthenica:ffmpeg-kit-full:6.0-2'
}
@jackyhieu1211 jackyhieu1211 changed the title FFmpegKit failed to start on brand samsung FFmpegKit failed to start on brand samsung: libffmpegkit_abidetect.so not found Mar 6, 2024
@tanersener tanersener added android Affect Android platform library Affects the library v6.0 not-reproducible labels Apr 11, 2024
@tanersener
Copy link
Collaborator

We haven't encountered this issue in our applications. I suggest testing if you can run the Android test applications under the ffmpeg-kit-test repository on those devices.

@jackyhieu1211
Copy link
Author

@tanersener
Thank you for your suggestion

I did a comparison between my project and ffmpeg-kit-test

I only see two difference

In ffmpeg-kit-test there is the following line added:

splits {
    abi {
        enable true
        reset()
        include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
        universalApk false
    }
}
}

ext.abiCodes = ['x86': 1, 'x86_64': 2, 'armeabi-v7a': 3, 'arm64-v8a': 4]

import com.android.build.OutputFile

android.applicationVariants.configureEach { variant ->
variant.outputs.each {
    output ->
        def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
        output.versionCodeOverride = baseAbiVersionCode + variant.versionCode
}
}
  1. in MainActivity have method registerApplicationFonts()
  • Does my project need that extra?. Thank you

@tanersener
Copy link
Collaborator

Have you verified that the test applications work fine on those devices but your app does not?

@jackyhieu1211
Copy link
Author

@tanersener
Sorry. I don't have all the above equipment.
The above error is what I received from Firebase Crashlytics.

Does my project need that extra?. Thank you

Should I add the above code?. Thank you!

@tanersener
Copy link
Collaborator

The first difference, in build.gradle, is actually a tip shared by Google in the Android documentation. See Configure dynamic version codes. It defines how apks are created. You don't have to use it. If you have another working solution that is also fine. But we don't know what that is. So, hard to say if using this conf will fix your issue. That's why reproducing the issue is essential.

The second difference is just an API call, it has not affect at all.

I see that you use version 6.0-2 in your app. I suggest trying the LTS version 6.0-2.LTS. LTS version supports more devices.

@jackyhieu1211
Copy link
Author

@tanersener
thank you. I will try it and feedback later

@jackyhieu1211
Copy link
Author

@tanersener
I tried version 6.0-2.LTS. The error still occurs.
I have switched to version 4.4 OLD. And It worked.
https://github.com/tanersener/mobile-ffmpeg

@jackyhieu1211
Copy link
Author

@tanersener
Sorry. Version 4.4 OLD found the same error.
I got bug in firebase Crashlytics

@tanersener
Copy link
Collaborator

Reproducing the issue is the only way to fix it.

@jackyhieu1211
Copy link
Author

@tanersener

Hello

I have tried on all the devices I have. from android7 -> android14.
All my devices work fine.

I received an error from Firebase Crashlytics.

I think in this case:

Do you add Try Catch when loading the library?
If possible. Please add an event so I can receive the error and ask the user to restart the application

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Affect Android platform library Affects the library not-reproducible v6.0
Projects
None yet
Development

No branches or pull requests

2 participants