MixinNetwork / MixinNetwork/flutter-plugins
[pasteboard] Copying image to clipboard throws PlatformException on Android
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 512
- Forks
- 292
- Avg merge
- 15h 8m
- Merged PRs (30d)
- 7
Description
Trying to copy an image to clipboard using Pasteboard.writeImage (Android setup was done already) fails with the following error:
I/flutter (28309): PlatformException(Error, Failed to write image, Failed to find configured root that contains /data/data/futuristicgoo.emotic.debug/cache/3eb33b68-e614-45f3-a8f3-68dd913bb9ad.png, null)
I/flutter (28309): Stacktrace: #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652:7)
I/flutter (28309): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:370:18)
I/flutter (28309): <asynchronous suspension>
I/flutter (28309): #2 PasteboardPlatformIO.writeImage (package:pasteboard/src/pasteboard_platform_io.dart:66:7)
I/flutter (28309): <asynchronous suspension>
I/flutter (28309): #3 copyImageToClipboard (package:emotic/core/helper_functions.dart:83:7)
I/flutter (28309): <asynchronous suspension>
Reproduce Steps
Steps to reproduce the behavior:
- Do Android setup steps - modifying the AndroidManifest.xml and adding the provider_paths.xml file as mentioned in README
- Use
Pasteboard.writeImage(imageBytes)API on Android 15 - See error
Expected behavior
The image copies without any error
Version:
- Flutter Version: 3.29.3
- OS: Android 15 (don't know if this is version specific)
- plugin: pasteboard: 0.4.0
Additional context
I was able to fix it by adding the following to provider_paths.xml
<cache-path
name="cache"
path="." />
So I guess this should be added to the README.md?
Thank you for your work btw ^_^
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The Android setup is described in README.md and uses provider_paths.xml with AndroidManifest.xml; start by comparing the documented paths with the failing Android 15 setup. Update the setup documentation to cover the required cache path, then verify that Pasteboard.writeImage copies an image without the PlatformException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, flutter
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100