[Question]: Unhandled Exception: MissingPluginException(No implementation found for method shareFiles on channel dev.fluttercommunity.plus/share)
What is your question?
i want to sharePlus file from pacckage sharePlus but getting this error
Future share(String urlImage, String content) async {
final url = urlImage;
// get file path from url
var response = await Dio()
.get(url, options: Options(responseType: ResponseType.bytes));
var bytes = response.data;
//temporary directory
var temp = await getTemporaryDirectory();
//Path
var path = "${temp.path}/images";
await File(path).writeAsBytes(bytes);
await Share.shareFiles([path], text: content);
}
I join the question
Restart helped
What you solved?
Any news about this one ? Have exactly the same issue here, despite the restart ...
Your question is missing some context:
- When are you calling that method?
- Which platform are you running the app on?
- Do you have the same issue when running the example project on the same device?
Your question is missing some context:
- When are you calling that method?
- Which platform are you running the app on?
- Do you have the same issue when running the example project on the same device?
Sorry mate, here's some context :
I get this error
Unhandled Exception: MissingPluginException(No implementation found for method share on channel dev.fluttercommunity.plus/share)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
<asynchronous suspension>
Here's my function
void _onShare(BuildContext context, String url) async {
await Share.share(
url, // text
subject: "Subject test",
);
}
Devices & versions
Flutter (Channel stable, 3.3.1, on macOS 12.5.1) & Iphone 13 Pro emulator iOS 15.5
I call this function on a ElevatedButton onPressed method and I get this error in my terminal !
Just tried the example on the same device, tapping on Share opens the dialog but when clicking the icon Messages then nothing happens
Well ended up restarting my simulator and the dialog opens but when clicking on Messages nothing happens ...
Thanks, this looks like two different issues (MissingPluginException on MacOS, and the share to Messages not working), could you open an issue ticket for each one of those?
Yessir ofc, right now :)
getting same issue with share_plus: ^4.1.0 in Android
Unhandled Exception: MissingPluginException(No implementation found for method share on channel dev.fluttercommunity.plus/share)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)
Anyupdate on this?
@himani2022 likely a bug on your side, since the example in share_plus/samples works
@miquelbeltran
added share_plus: ^4.1.0 to yaml
and
import 'package:share_plus/share_plus.dart'; void shareToSocial() { Share.share('check out my website https://example.com'); }
Did I miss something?
Probably yes, because if I create a new project with flutter create, add the dependency with flutter pub add share_plus, add the import and call to the same Share method inside _incrementCounter() it works.
@himani2022 I had the same problem, but after flutter clean and flutter pub get, it was working fine for me.
@minhdanh That's the correct solution. When you include a plugin dependency, the Dart code can instantly be incorporated, but any plugin code may require either a restart or a clean.
This should be closed if @agusryank does not experience this problem anymore.
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
i have the same problem for add to old project. [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method share on channel dev.fluttercommunity.plus/share). If i try to create new project it work find. But i need to add to exist project on create new project.