[Bug]: Share.shareXFiles in Windows 11 return ShareResultStatus.unavailable
Platform
Windows
Plugin
share_plus
Version
10.0.1
Flutter SDK
3.22.1
Steps to reproduce
I called Share.shareXFiles in Windows 11, but the result returned ShareResultStatus.unavailable.
Code Sample
No response
Logs
--
Flutter Doctor
[√] Flutter (Channel stable, 3.22.1, on Microsoft Windows [版本 10.0.22631.3958], locale zh-CN)
• Flutter version 3.22.1 on channel stable at C:\dev\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a14f74ff3a (3 months ago), 2024-05-22 11:08:21 -0500
• Engine revision 55eae6864b
• Dart version 3.4.1
• DevTools version 2.34.3
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[√] Windows Version (Installed version of Windows is version 10 or higher)
[X] Android toolchain - develop for Android devices
• Android SDK at C:\Users\Administrator\AppData\Local\Android\sdk
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.3)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.7.34024.191
• Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2022.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
[√] VS Code (version 1.80.0)
• VS Code at C:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.94.0
[√] Connected device (1 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.22631.3958]
[√] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
Checklist before submitting a bug
- [X] I searched issues in this repository and couldn't find such bug/problem
- [X] I Google'd a solution and I couldn't find it
- [X] I searched on StackOverflow for a solution and I couldn't find it
- [X] I read the README.md file of the plugin
- [X] I'm using the latest version of the plugin
- [X] All dependencies are up to date with
flutter pub upgrade - [X] I did a
flutter clean - [X] I tried running the example project
I am facing the same problem on windows
ShareResultStatus.unavailable is an expected result, it means that the share result cannot be determined.
Is there any other issue you are facing? Otherwise, I will close this ticket.
I am using the exact same code to share an image that I generated. shareXfiles is working perfectly on IOS Mac And Android. Only Windows gets me this message: ShareResultStatus.unavailable .
is there any explanation or can I do anything to fix it, please?
As explained, ShareResultStatus.unavailable is an expected output. Can you provide logs and explain exactly what happens?
First I am taking a screenshot through the package: ScreenShot :
final image = await _screenshotController.captureFromLongWidget( context: context, InheritedTheme.captureAll( context, FileMatchingContent( ), to: context, ), pixelRatio: 2, );
after that: iam using share_plus to share this image :
final Size size = MediaQuery.of(context).size; final results = await Share.shareXFiles( sharePositionOrigin: Rect.fromLTWH( 0, 0, size.width, size.height / 2, ), [ XFile.fromData( image, mimeType: "image/png", ), ], );
after that :
print(results.status);
===============================
I don't have any log except the print statement: ShareResultStatus.unavailable
this code works on every platform except windows.
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