Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Share.shareXFiles in Windows 11 return ShareResultStatus.unavailable #3177

Open
8 tasks done
zhahouming opened this issue Aug 12, 2024 · 5 comments
Open
8 tasks done
Labels
bug Something isn't working triage

Comments

@zhahouming
Copy link

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:/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

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@zhahouming zhahouming added bug Something isn't working triage labels Aug 12, 2024
@embroor
Copy link

embroor commented Aug 19, 2024

I am facing the same problem on windows

@miquelbeltran
Copy link
Member

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.

@embroor
Copy link

embroor commented Aug 19, 2024

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?

@miquelbeltran
Copy link
Member

As explained, ShareResultStatus.unavailable is an expected output. Can you provide logs and explain exactly what happens?

@embroor
Copy link

embroor commented Aug 19, 2024

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

Screenshot 2024-08-19 at 6 38 21 PM

this code works on every platform except windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

3 participants