justsoft / video_thumbnail

This plugin generates thumbnail from video file or URL. It returns image in memory or writes into a file. It offers rich options to control the image format, resolution and quality. Supports iOS and Android.
MIT License
183 stars 238 forks source link

Error: No implementation found for method file on channel video_thumbnail (Android 11) #77

Closed joankabello closed 3 years ago

joankabello commented 3 years ago

Hello,

On Android 11 when trying to create a thumbnail from a file path i get the error attached. Is there a known issue with Android 11 ? With Android 10 or lower it works fine and doesn't throw any errors.

W/System.err( 4329): java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA W/System.err( 4329): at android.media.MediaMetadataRetriever._setDataSource(Native Method) W/System.err( 4329): at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:272) W/System.err( 4329): at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:238) W/System.err( 4329): at xyz.justsoft.video_thumbnail.VideoThumbnailPlugin.createVideoThumbnail(VideoThumbnailPlugin.java:201) W/System.err( 4329): at xyz.justsoft.video_thumbnail.VideoThumbnailPlugin.buildThumbnailData(VideoThumbnailPlugin.java:116) W/System.err( 4329): at xyz.justsoft.video_thumbnail.VideoThumbnailPlugin.buildThumbnailFile(VideoThumbnailPlugin.java:132) W/System.err( 4329): at xyz.justsoft.video_thumbnail.VideoThumbnailPlugin.access$000(VideoThumbnailPlugin.java:37) W/System.err( 4329): at xyz.justsoft.video_thumbnail.VideoThumbnailPlugin$1.run(VideoThumbnailPlugin.java:73) W/System.err( 4329): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) W/System.err( 4329): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) W/System.err( 4329): at java.lang.Thread.run(Thread.java:923) E/flutter ( 4329): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Unhandled error MissingPluginException(No implementation found for method file on channel video_thumbnail) occurred in Instance of 'PreviewBloc'.

narger-ef commented 3 years ago

Similar here:

E/flutter (13847): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: MissingPluginException(No implementation found for method data on channel video_thumbnail)

in

E/flutter (13847): #1 VideoThumbnail.thumbnailData package:video_thumbnail/video_thumbnail.dart:67

only on Android 11, on previous versions it works.

reinhold-b commented 3 years ago

Same issue here, anything new on that? Also, are there other packages for thumbnail creation that work on Android 11?

ah89 commented 3 years ago

The same problem here

WaheedHussainHaans commented 3 years ago

Same problem here any solution yet?

justsoft commented 3 years ago

Have you tried to add permission: android:requestLegacyExternalStorage="true"?

joankabello commented 3 years ago

@justsoft Yes have done that

justsoft commented 3 years ago

This plugin uses Android built-in media player, verify it is playable by the device's browser or media player.

Aadeesh11 commented 2 years ago

The same problem here, how to solve this? @justsoft

julek-kal commented 2 years ago

I had this problem too and I solved this on my fork. You can use it by change dependency in pubspec.yaml as follow

video_thumbnail:
    git:
      url: https://github.com/julek-kal/video_thumbnail
      ref: 734a2d5      

I have had create also PR here #91

emvaized commented 2 years ago

@julek-kal I still get this error with your fork somehow

E/flutter (25087): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method data on channel plugins.justsoft.xyz/video_thumbnail)
E/flutter (25087): #0      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:154
E/flutter (25087): <asynchronous suspension>
E/flutter (25087): #1      VideoThumbnail.thumbnailData
package:video_thumbnail/video_thumbnail.dart:67
E/flutter (25087): <asynchronous suspension>
E/flutter (25087): #2      _VideoThumbnailState._getThumbnailAtCount
package:filex/…/file_icons/video_thumbnail.dart:86
E/flutter (25087): <asynchronous suspension>
E/flutter (25087):
Alexspriet commented 2 years ago

Same here

andreasmpet commented 2 years ago

I get this error sporadically. Not completely sure why or what is happening. I have a little hunch it has something to do with concurrency, but can't confirm that.