[Question]: Unhandled Exception: PlatformException(Share callback error, prior share-sheet did not call back, did you await it? Maybe use non-result variant, null, null)
What is your question?
I use flutter version 3.16.3. flutter doctor and everything other is ok.
Here is some brief codes: String dir = (await getTemporaryDirectory()).path; String saveFileName = user.userName.replaceAll('/', '_')+ Constant.SAVE_FORMAT; File saveFile = File('$dir/$saveFileName' ); Share.shareXFiles([XFile(saveFile.path)], text: 'sharing');
Here is the error log:
I/flutter ( 8533): parent: /storage/emulated/0/Android/data
I/flutter ( 8533): /storage/emulated/0/Android/data/com.tencent.mm/MicroMsg/Download
I/flutter ( 8533): delFile: /storage/emulated/0/Android/data/com.tencent.mm/MicroMsg/Download/B.E.G. DALI-LINK.beglnk
E/flutter ( 8533): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(Share callback error, prior share-sheet did not call back, did you await it? Maybe use non-result variant, null, null)
E/flutter ( 8533): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7)
E/flutter ( 8533): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18)
E/flutter ( 8533):
Checklist before submitting a question
- [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 am 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
It's only occured when share a file to my own APP. Beacuse I can receive files from other APP, so I can share a file to my own APP.
I have the same issue
@llyl could you find a solution?