[share_plus] PlatformException(file:/storage/emulated/0/Pictures/property_asa_136.jpg: open failed: ENOENT (No such file or directory), null, null, null)"
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.
@mhadaily @thealteria can I take up this task? I would love to fix it
sure, waiting for your Pr @loud-at-heart
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
@mhadaily @loud-at-heart any updates here?
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);
it's almost been 1 year guys. Still no updates?
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
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.
Closing as requested info was not provided.