clipboard_watcher icon indicating copy to clipboard operation
clipboard_watcher copied to clipboard

(PlatformException(Clipboard error, Unable to open clipboard, 5, null)

Open keith555 opened this issue 2 years ago • 3 comments

PlatformException (PlatformException(Clipboard error, Unable to open clipboard, 5, null))

I'm getting this error on Windows 11 Home running the example app. It sometimes throws the error on the first copy, sometimes after one or two successful copies. I don't know if this is related.

keith555 avatar Jun 08 '23 18:06 keith555

I have the same problem [ ] #0 JSONMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:171:7) [ ] #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18) [ ] <asynchronous suspension> [ ] #2 Clipboard.getData (package:flutter/src/services/clipboard.dart:52:42) [ ] <asynchronous suspension>

peyman1959 avatar Jul 15 '23 18:07 peyman1959

PlatformException (PlatformException(Clipboard error, Unable to open clipboard, 5, null))

I'm getting this error on Windows 11 Home running the example app. It sometimes throws the error on the first copy, sometimes after one or two successful copies. I don't know if this is related.

This error may occur when there are other applications simultaneously accessing the clipboard, and the previous program has not released the clipboard lock, resulting in inability to acquire the lock.

aa2013 avatar Apr 04 '24 05:04 aa2013

You can independently implement the corresponding platform method and then add a delayed retry mechanism, which can basically eliminate the problem

aa2013 avatar Apr 04 '24 05:04 aa2013