Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading file from clipboard throws virtualFileReceiveError #86

Closed
adil192 opened this issue Mar 19, 2023 · 3 comments · Fixed by #88
Closed

Reading file from clipboard throws virtualFileReceiveError #86

adil192 opened this issue Mar 19, 2023 · 3 comments · Fixed by #88

Comments

@adil192
Copy link

adil192 commented Mar 19, 2023

When running reader.getFile(Formats.png, ...) on Windows 11, I get this exception:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(super_native_extensions_error, virtual file receive error: item not found, virtualFileReceiveError, null)
This doesn't occur if I set allowVirtualFiles to false in the reader.getFile call.

Code snippet

final reader = await ClipboardReader.readClipboard();
final futures = <Future>[];
for (SimpleFileFormat format in formats) {
  if (!reader.canProvide(format)) continue;
  reader.getFile(format, (file) {
    futures.add(processFile(file, format));
  });
}
await Future.wait(futures);
  • the processFile function never gets run since reader.getFile throws without running the onFile callback.
  • formats is a list of image formats (Formats.jpeg, Formats.png, etc) but when I tested with just Formats.png the error still occured.
@knopp
Copy link
Collaborator

knopp commented Mar 19, 2023

Seems like a regression. Which application are you trying to copy content from?

@adil192
Copy link
Author

adil192 commented Mar 19, 2023

I'm copying an image file from the Windows file explorer

@knopp
Copy link
Collaborator

knopp commented Mar 19, 2023

This seems to be a bug in windows explorer IDataObject implementation. Should now be fixed in main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants