Solved: flutter ffmpeg_kit_flutter ResultHandler can not send event on a null event sink

Question

Asked by saeid t on December 07, 2021 (source).

on my personal project, I get the same error from any package that uses the ffmpeg_kit_flutter package, which I am sure is related to ffmpeg.

 D/ffmpeg-kit-flutter( 4235): FFmpegKitFlutterPlugin started listening to events on 
io.flutter.plugin.common.Ev[email protected]dde1f1b.

I/flutter ( 4235): Loaded ffmpeg-kit-flutter-android-https-x86-4.5.0-lts.
W/ffmpeg-kit-flutter( 4235): ResultHandler can not send event {FFmpegKitExecuteCallbackEvent=
{createTime=1638730375609, startTime=1638730375618, sessionId=1, type=1, command=
-ss 0:00:00.000000 -i /data/user/0/com.sm.smofficial/cache/file_picker/VID_20211102_030320.mp4
 -t 0:00:10.000000 -avoid_negative_ts make_zero -c:a copy -c:v copy /data/user/0/com.sm.smofficia
l/app_flutter/Trimmer/VID_20211102_030320_trimmed:Dec5,2021-13:52:55.mp4}} on a null event sink.

according to the document, there is no special configuration, I just put this code snippet in the manifest

<uses-sdk tools:overrideLibrary="com.arthenica.ffmpegkit.flutter, com.arthenica.ffmpegkit" />

Answer

Question answered by dhcracchiolo (source).

Try changing the dependency in your pubspec.yaml to:

  ffmpeg_kit_flutter:
    git:
      url: https://github.com/shilangyu/ffmpeg-kit
      ref: development-flutter
      path: prebuilt/bundle-flutter-lts/default

This will just make it so you're on the latest of the development-flutter branch. If you're using FirebaseMessaging this should solve it. This worked for me. Read more here: https://github.com/tanersener/ffmpeg-kit/issues/209

ANDROID-FFMPEG DART FFMPEG FLUTTER
SHARE: