plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[share_plus] PlatformException(file:/storage/emulated/0/Pictures/property_asa_136.jpg: open failed: ENOENT (No such file or directory), null, null, null)"

Open thealteria opened this issue 2 years ago • 6 comments

So I'm using share_plus library to share my image which I downloaded from the api but when I'm trying to share it it' giving me 'PlatformException' Error. Here's the code I'm using:

final result = await ImageGallerySaver.saveImage(
      bytes,
      quality: 100,
      name: fileName,
    );
    printInfo(info: 'file download ended');
    printInfo(
      info: 'result: ${result['filePath']}',
    );

await Share.shareFiles(
        [
          result['filePath'],
        ],
      ).catchError((e) {
        printInfo(info: 'error: ${e.toString()}');
      });

I'm getting the path successfully and saved image is also showing in the gallery on the exact same location but it's giving me error.

thealteria avatar Sep 03 '21 13:09 thealteria

@mhadaily @thealteria can I take up this task? I would love to fix it

loud-at-heart avatar Oct 02 '21 19:10 loud-at-heart

sure, waiting for your Pr @loud-at-heart

mhadaily avatar Oct 03 '21 09:10 mhadaily

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar May 31 '22 15:05 github-actions[bot]

@mhadaily @loud-at-heart any updates here?

followthemoney1 avatar Jun 06 '22 12:06 followthemoney1

in my case helps:

    final String dir = (await getApplicationDocumentsDirectory()).path;
    final _path = '$dir/$filename';
    File(_path).writeAsBytesSync(response.data!);
    final file = XFile(_path);
    print('is exist ${file.path} and origin: $_path');

instead of using XFiles:

final String dir = (await getApplicationDocumentsDirectory()).path;
final _path = '$dir/$filename';
final file = XFile.fromData(response.data!, path: _path);

followthemoney1 avatar Jun 06 '22 12:06 followthemoney1

it's almost been 1 year guys. Still no updates?

thealteria avatar Jul 29 '22 16:07 thealteria

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Oct 28 '22 00:10 github-actions[bot]

it's almost been 1 year guys. Still no update

Do you still have this problem?

Can you try again with the last version of share_plus?

Can you provide a complete bug report. e.g. logs and flutter doctor output?

The problem is that if you write an incomplete bug report without specifying things like the platform, the Flutter version, the plugin version, not including logs, etc. we cannot guess what problem you have.

miquelbeltran avatar Oct 28 '22 05:10 miquelbeltran

Closing as requested info was not provided.

vbuberen avatar Dec 10 '22 20:12 vbuberen