Skip to content

[Bug]: Share.shareXFiles is not working on my Android 11 device but Share.shareFiles is working #1612

@Tom3652

Description

@Tom3652

Platform

Android 11

Plugin

share_plus

Version

6.3.0

Flutter SDK

3.7.6

Steps to reproduce

I am calling :

 await Share.shareFiles([(filePath)], subject: "A nice subject");

And it's working fine, but this method is deprecated.

So i have tried to use :

await Share.shareXFiles([XFile(filePath)], subject: "A nice subject");

And here is the output : PlatformException(Share callback error, prior share-sheet did not call back, did you await it? Maybe use non-result variant, null, null)

With the exact same filePath

The only thing i have found on Google which was not helpful was : https://stackoverflow.com/questions/71855220/flutter-package-share-plus-unexpected-async-await-behaviour but this doesn't seem to match my behavior since it's working with the deprecated method.

Code Sample

call `await Share.shareXFiles([XFile(filePath)], subject: "A nice subject")` and see the error.

Logs

There is nothing helpful so i am attaching the only log i have got : 

`PlatformException(Share callback error, prior share-sheet did not call back, did you await it? Maybe use non-result variant, null, null)`

Flutter Doctor

[✓] Flutter (Channel stable, 3.7.6, on macOS 13.2.1 22D68 darwin-x64, locale fr-FR)
    • Flutter version 3.7.6 on channel stable at /Users/foxtom/Desktop/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 12cb4eb7a0 (10 days ago), 2023-03-01 10:29:26 -0800
    • Engine revision ada363ee93
    • Dart version 2.19.3
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/foxtom/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.12.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.76.1)
    • VS Code at /Users/foxtom/Desktop/Visual Studio Code.app/Contents
    • Flutter extension version 3.46.0

[✓] Connected device (3 available)
    • moto g 8 power (mobile) • adb-ZY22BNDW2C-yyjDO7._adb-tls-connect._tcp. • android-arm64  • Android 11 (API 30)
    • macOS (desktop)         • macos                                        • darwin-x64     • macOS 13.2.1 22D68 darwin-x64
    • Chrome (web)            • chrome                                       • web-javascript • Google Chrome 110.0.5481.177

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Checklist before submitting a bug

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions