[pasteboard] Copying image to clipboard throws PlatformException on Android

Open Beginner friendly
#413 0 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
68/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
android, flutter
Domain
documentation

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.

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:

  1. Do Android setup steps - modifying the AndroidManifest.xml and adding the provider_paths.xml file as mentioned in README
  2. Use Pasteboard.writeImage(imageBytes) API on Android 15
  3. 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 ^_^

Dominant language
C
Stars
512
Forks
292
Avg merge
15h 8m
Merged PRs (30d)
7

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MixinNetwork/flutter-plugins

All issues in MixinNetwork/flutter-plugins

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.