jonataslaw / VideoCompress

Compress videos, remove audio, manipulate thumbnails, and make your video compatible with all platforms through this lightweight and efficient library.
MIT License
230 stars 279 forks source link

java.lang.IllegalArgumentException: Unsupported value: 'kotlin.Unit' of type 'class kotlin.Unit' #221

Open cnkygmr opened 1 year ago

cnkygmr commented 1 year ago

MediaInfo? mediaInfo = await VideoCompress.compressVideo(file.path, quality: VideoQuality.MediumQuality, includeAudio: true);

I use it this way, it works normally, but when I leave the page I am processing, it gives the following error? I want it to continue doing it in the background but it throws an error

E/MethodChannel#video_compress( 3765): Failed to handle method call
E/MethodChannel#video_compress( 3765): java.lang.IllegalArgumentException: Unsupported value: 'kotlin.Unit' of type 'class kotlin.Unit'
E/MethodChannel#video_compress( 3765):  at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:297)
E/MethodChannel#video_compress( 3765):  at io.flutter.plugin.common.StandardMethodCodec.encodeSuccessEnvelope(StandardMethodCodec.java:61)
E/MethodChannel#video_compress( 3765):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:263)
E/MethodChannel#video_compress( 3765):  at com.example.video_compress.VideoCompressPlugin.onMethodCall(VideoCompressPlugin.kt:67)
E/MethodChannel#video_compress( 3765):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#video_compress( 3765):  at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#video_compress( 3765):  at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#video_compress( 3765):  at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#video_compress( 3765):  at android.os.Handler.handleCallback(Handler.java:873)
E/MethodChannel#video_compress( 3765):  at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#video_compress( 3765):  at android.os.Looper.loop(Looper.java:193)
E/MethodChannel#video_compress( 3765):  at android.app.ActivityThread.main(ActivityThread.java:6669)
E/MethodChannel#video_compress( 3765):  at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#video_compress( 3765):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#video_compress( 3765):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/DartMessenger( 3765): Uncaught exception in binary message listener
E/DartMessenger( 3765): java.lang.IllegalStateException: Reply already submitted
E/DartMessenger( 3765):     at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:435)
E/DartMessenger( 3765):     at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:278)
E/DartMessenger( 3765):     at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/DartMessenger( 3765):     at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/DartMessenger( 3765):     at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/DartMessenger( 3765):     at android.os.Handler.handleCallback(Handler.java:873)
E/DartMessenger( 3765):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/DartMessenger( 3765):     at android.os.Looper.loop(Looper.java:193)
E/DartMessenger( 3765):     at android.app.ActivityThread.main(ActivityThread.java:6669)
E/DartMessenger( 3765):     at java.lang.reflect.Method.invoke(Native Method)
E/DartMessenger( 3765):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/DartMessenger( 3765):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
karamatpkid commented 1 year ago

Same error is here, any update?

karamatpkid commented 1 year ago

E/MethodChannel#video_compress( 9851): Failed to handle method call E/MethodChannel#video_compress( 9851): java.lang.IllegalArgumentException: Unsupported value: 'kotlin.Unit' of type 'class kotlin.Unit' E/MethodChannel#video_compress( 9851): at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:297) E/MethodChannel#video_compress( 9851): at io.flutter.plugin.common.StandardMethodCodec.encodeSuccessEnvelope(StandardMethodCodec.java:61) E/MethodChannel#video_compress( 9851): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:263) E/MethodChannel#video_compress( 9851): at com.example.video_compress.VideoCompressPlugin.onMethodCall(VideoCompressPlugin.kt:67) E/MethodChannel#video_compress( 9851): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258) E/MethodChannel#video_compress( 9851): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) E/MethodChannel#video_compress( 9851): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322) E/MethodChannel#video_compress( 9851): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/MethodChannel#video_compress( 9851): at android.os.Handler.handleCallback(Handler.java:942) E/MethodChannel#video_compress( 9851): at android.os.Handler.dispatchMessage(Handler.java:99) E/MethodChannel#video_compress( 9851): at android.os.Looper.loopOnce(Looper.java:226) E/MethodChannel#video_compress( 9851): at android.os.Looper.loop(Looper.java:313) E/MethodChannel#video_compress( 9851): at android.app.ActivityThread.main(ActivityThread.java:8757) E/MethodChannel#video_compress( 9851): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#video_compress( 9851): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) E/MethodChannel#video_compress( 9851): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067) E/DartMessenger( 9851): Uncaught exception in binary message listener E/DartMessenger( 9851): java.lang.IllegalStateException: Reply already submitted E/DartMessenger( 9851): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:435) E/DartMessenger( 9851): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:278) E/DartMessenger( 9851): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) E/DartMessenger( 9851): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322) E/DartMessenger( 9851): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/DartMessenger( 9851): at android.os.Handler.handleCallback(Handler.java:942) E/DartMessenger( 9851): at android.os.Handler.dispatchMessage(Handler.java:99) E/DartMessenger( 9851): at android.os.Looper.loopOnce(Looper.java:226) E/DartMessenger( 9851): at android.os.Looper.loop(Looper.java:313) E/DartMessenger( 9851): at android.app.ActivityThread.main(ActivityThread.java:8757) E/DartMessenger( 9851): at java.lang.reflect.Method.invoke(Native Method) E/DartMessenger( 9851): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) E/DartMessenger( 9851): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Neelansh-ns commented 1 year ago

Same

E/MethodChannel#video_compress(22646): Failed to handle method call
E/MethodChannel#video_compress(22646): java.lang.IllegalArgumentException: Unsupported value: 'kotlin.Unit' of type 'class kotlin.Unit'
E/MethodChannel#video_compress(22646):  at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:297)
E/MethodChannel#video_compress(22646):  at io.flutter.plugin.common.StandardMethodCodec.encodeSuccessEnvelope(StandardMethodCodec.java:63)
E/MethodChannel#video_compress(22646):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:267)
E/MethodChannel#video_compress(22646):  at com.example.video_compress.VideoCompressPlugin.onMethodCall(VideoCompressPlugin.kt:68)
E/MethodChannel#video_compress(22646):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/MethodChannel#video_compress(22646):  at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#video_compress(22646):  at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#video_compress(22646):  at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#video_compress(22646):  at android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#video_compress(22646):  at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#video_compress(22646):  at android.os.Looper.loopOnce(Looper.java:210)
E/MethodChannel#video_compress(22646):  at android.os.Looper.loop(Looper.java:299)
E/MethodChannel#video_compress(22646):  at android.app.ActivityThread.main(ActivityThread.java:8319)
E/MethodChannel#video_compress(22646):  at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#video_compress(22646):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
E/MethodChannel#video_compress(22646):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
E/DartMessenger(22646): Uncaught exception in binary message listener
E/DartMessenger(22646): java.lang.IllegalStateException: Reply already submitted
E/DartMessenger(22646):     at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:430)
E/DartMessenger(22646):     at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:282)
E/DartMessenger(22646):     at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/DartMessenger(22646):     at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/DartMessenger(22646):     at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/DartMessenger(22646):     at android.os.Handler.handleCallback(Handler.java:938)
E/DartMessenger(22646):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/DartMessenger(22646):     at android.os.Looper.loopOnce(Looper.java:210)
E/DartMessenger(22646):     at android.os.Looper.loop(Looper.java:299)
E/DartMessenger(22646):     at android.app.ActivityThread.main(ActivityThread.java:8319)
E/DartMessenger(22646):     at java.lang.reflect.Method.invoke(Native Method)
E/DartMessenger(22646):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
E/DartMessenger(22646):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
lakshmansha commented 1 year ago

I am also facing the same issue.

gOzaru commented 1 year ago

I think the problem is in video format. It should be mp4 only. And it cannot be using Adobe Media Encoder to compile it. Sometime the format is read as mp4v and that is not compatible and caused such error.

karamatpkid commented 1 year ago

Not due to Mp4, because in my folder all videos are in MP4.

On Thu, Jun 1, 2023, 7:53 AM Wege @.***> wrote:

I think the problem is in video format. It should be mp4 only. And it cannot be using Adobe Media Encoder to compile it. Sometime the format is read as mp4v and that is not compatible and caused such error.

— Reply to this email directly, view it on GitHub https://github.com/jonataslaw/VideoCompress/issues/221#issuecomment-1571248268, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVWX46P7EYAH7OGT2ELKHLTXI7727ANCNFSM6AAAAAAUHLZAQI . You are receiving this because you commented.Message ID: @.***>