Fatal exception Android
Description We have developed an application that uses this package to merge video's together, everything works fine and we are live. Now I want to continue adding new features to the app, but when I try to use app (tested functionality) there occurs a fatal exception. I first call a ffprobe command, and then one to multiple ffmpeg commands.
NOTE: We still use an old version of flutter for certain legacy compatibility features, this should not be a problem for ffmpeg because it worked before.
Expected behavior ffmpeg execute to return zero and therefore succeeds.
Current behavior App crashed immidiately, as seen in the stacktrace. It crashes at loading ffmpeg.
Logs
I/mobile-ffmpeg(18111): Loading mobile-ffmpeg.
E/AndroidRuntime(18111): FATAL EXCEPTION: AsyncTask #7
E/AndroidRuntime(18111): Process: com.iconica.powermessage, PID: 18111
E/AndroidRuntime(18111): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime(18111): at android.os.AsyncTask$4.done(AsyncTask.java:415)
E/AndroidRuntime(18111): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime(18111): at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime(18111): at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime(18111): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
E/AndroidRuntime(18111): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(18111): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(18111): at java.lang.Thread.run(Thread.java:923)
E/AndroidRuntime(18111): Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libmobileffmpeg_abidetect.so" not found
E/AndroidRuntime(18111): at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
E/AndroidRuntime(18111): at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
E/AndroidRuntime(18111): at java.lang.System.loadLibrary(System.java:1664)
E/AndroidRuntime(18111): at com.arthenica.mobileffmpeg.AbiDetect.<clinit>(AbiDetect.java:40)
E/AndroidRuntime(18111): at com.arthenica.mobileffmpeg.AbiDetect.getNativeAbi(Native Method)
E/AndroidRuntime(18111): at com.arthenica.mobileffmpeg.Config.<clinit>(Config.java:111)
E/AndroidRuntime(18111): at com.arthenica.mobileffmpeg.Config.nativeFFprobeExecute(Native Method)
E/AndroidRuntime(18111): at com.arthenica.mobileffmpeg.FFprobe.execute(FFprobe.java:55)
E/AndroidRuntime(18111): at com.arthenica.mobileffmpeg.FFprobe.getMediaInformation(FFprobe.java:86)
E/AndroidRuntime(18111): at com.arthenica.flutter.ffmpeg.FlutterFFmpegGetMediaInformationAsyncTask.doInBackground(FlutterFFmpegGetMediaInformationAsyncTask.java:51)
E/AndroidRuntime(18111): at com.arthenica.flutter.ffmpeg.FlutterFFmpegGetMediaInformationAsyncTask.doInBackground(FlutterFFmpegGetMediaInformationAsyncTask.java:36)
E/AndroidRuntime(18111): at android.os.AsyncTask$3.call(AsyncTask.java:394)
E/AndroidRuntime(18111): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(18111): ... 4 more
Environment [✓] Flutter (Channel stable, 1.22.6, on macOS 11.2.1 20D75 darwin-x64, locale nl-NL) • Flutter version 1.22.6 at /Users/nielsgorter/Development/Frameworks/flutter • Framework revision 9b2d32b605 (4 months ago), 2021-01-22 14:36:39 -0800 • Engine revision 2f0af37152 • Dart version 2.10.5
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/nielsgorter/Library/Android/sdk • Platform android-30, build-tools 30.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.5) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.5, Build version 12E262 • CocoaPods version 1.10.1
[✓] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin installed • Dart plugin version 201.9317 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.56.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.22.0
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
After looking through multiple issues here, I fixed it with the help of these:
https://github.com/tanersener/flutter-ffmpeg/issues/198 https://github.com/tanersener/mobile-ffmpeg/issues/497