Unable to share image in Redmi device
Platform
Android 10
Plugin
share_plus
Version
share_plus 4.0.10+1
Flutter SDK
3.0.5
Steps to reproduce

Code Sample
try {
var boundary =
widgetKey.currentContext?.findRenderObject() as RenderRepaintBoundary;
// if it needs repaint, we paint it.
//if (boundary.debugNeedsPaint) {}
var image = await boundary.toImage(pixelRatio: 3.0);
var byteData = (await image.toByteData(format: ImageByteFormat.png))!;
var pngBytes = byteData.buffer.asUint8List();
final tempDirPath = (await getTemporaryDirectory()).path;
final file = await File('$tempDirPath/image.png').create();
await file.writeAsBytes(pngBytes);
paths.add(file.path);
await Share.shareFiles(
paths,
mimeTypes: ['image/png'],
subject: subject,
text: text,
); //subject,
} catch (e) {
print(e.toString());
}
Logs
Facing issue when share image to REDMI device as you can see the attached image.
Flutter Doctor
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.3.1 21E258 darwin-x64, locale en-QA)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
• No issues found!
Hi @adnankhan74444 could you check if:
- this issue happens with other files
- this issue happens when sharing with other apps (e.g. Telegram?)
- this issue happens when implementing the share intent natively on Android (if you have enough Android experience to try that)
thanks!
Hi @miquelbeltran
But the same code and same scenario is working fine on other devices (Samsung and Iphone), this issue is only happening in REDMI device.
Hi @miquelbeltran I am also facing this issue just for Redmi device. When i try to attach file with Redmi device file is not attaching with gmail. Same error i am geeting.
Error : can't attach file
Hi
I am also facing same issue with this device type, can you please look into this issue
Thanks Chora
Hi I am also facing same issue with this device type, can you please look into this issue
Feel free to try to debug the issue and figure out what is wrong, since you also own this device. If you send a PR with the fix I will review and merge asap, but don't expect me to work on it.
I'm also facing same issue, any one solved yet or not.
To resolve the issue we need proper logs instead of what the author of the issue wrote in Logs section.
Also don't have Redmi device, so can't check the problem.
I have a Xiaomi device and would be happy to test this in the beginning of October (and maybe even fix it as part of Hacktoberfest). I will let you know as soon as possible if I can reproduce this error on my device.
I have tested it and it does not seem to be reproducible on my Xiaomi Mi 9T Pro. So, sadly, I cannot fix this, I am sorry.
I have done this for other app like what's app.
Hi there, while I don't have any Android device at all, I am very familiar with our implementation for Android. When we share files on Android, we first stash them in a cache directory to grant other applications access to them. If I were to investigate this issue (which I can't) that's where I would look first :)
@adnankhan74444 Could you share the logs from flutter run?
After talking with an user who was experiencing this issue it looks like disabling MIUI optimizations solves the problem. Still, it would be good to have some logs to see if is viable to fix in the plugin's side.

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
This issue still exists
Without meaningful logs we won't be able to help. Also, having experience with Xiaomi specific bugs some years ago when I was doing only Android, I believe, there still be a set of Xiaomi/Redmi devices for which it won't be possible to fix the issue.
@vbuberen Yes, it would be great if someone that can reproduce the issue could share some logs.
I don't think it should be closed for inactivity though, someone may encounter with this and share a PR with a fix.
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