fluttercandies / flutter_image_editor

Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.
Apache License 2.0
414 stars 126 forks source link

Error: MissingPluginException(No implementation found for method memoryToMemory on channel top.kikt/flutter_image_editor) #44

Closed kokocooler2020 closed 4 years ago

kokocooler2020 commented 4 years ago

flutter channel: dev (Flutter Web).

when run code below on Flutter Web: final editorOption = editor.ImageEditorOption(); editorOption.addOption(editor.RotateOption(-90)); editorOption.outputFormat = editor.OutputFormat.jpeg(100); Future list = editor.ImageEditor.editImage(image: imageData.srcImageBytes, imageEditorOption: editorOption);

i got: Overflow on channel: top.kikt/flutter_image_editor. Messages on this channel are being discarded in FIFO fashion. The engine may not be running or you need to adjust the buffer size if of the channel. Error: MissingPluginException(No implementation found for method memoryToMemory on channel top.kikt/flutter_image_editor)

any body help please, thank you.

CaiJingLong commented 4 years ago

The problem because flutter plugin(have native code) is not support hot restart/hot reload. So you must exit app and rerun.

tk2232 commented 3 years ago

I got the same error on web. Even when I rerun the app

Here is my code

Future<Uint8List?> cropImage(ExtendedImageEditorState state) async {
    var action = state.editAction;

    ///crop rect base on raw image
    final Rect? rect = state.getCropRect();
    final rotateAngle = action?.rotateAngle.toInt();
    final flipHorizontal = action?.flipY;
    final flipVertical = action?.flipX;
    final img = state.rawImageData;

    ImageEditorOption option = ImageEditorOption();

    if (action!.needCrop) option.addOption(ClipOption.fromRect(rect!));

    if (action.needFlip)
      option.addOption(
          FlipOption(horizontal: flipHorizontal!, vertical: flipVertical!));

    if (action.hasRotateAngle) option.addOption(RotateOption(rotateAngle!));

    final result = await ImageEditor.editImage(
      image: img,
      imageEditorOption: option,
    );
    return result;
  }
DivisionBell commented 3 years ago

I have the same problem. Exit and return doesnt help. I also tried "Flutter clean" but it still doesnt work.

irajeshh commented 2 years ago

Had the same issue, the reason is this plugin doesn't support web. We need to use cropImageDataWithDartLibrary on web