plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Question]: Unhandled Exception: MissingPluginException(No implementation found for method shareFiles on channel dev.fluttercommunity.plus/share)

Open agusryank opened this issue 3 years ago • 15 comments

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);
  }

agusryank avatar Aug 23 '22 15:08 agusryank

I join the question

ron-diesel avatar Aug 26 '22 12:08 ron-diesel

Restart helped

ron-diesel avatar Aug 26 '22 14:08 ron-diesel

What you solved?

longtaozz avatar Aug 31 '22 09:08 longtaozz

Any news about this one ? Have exactly the same issue here, despite the restart ...

eloipeloux avatar Sep 16 '22 09:09 eloipeloux

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?

miquelbeltran avatar Sep 16 '22 09:09 miquelbeltran

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 !

eloipeloux avatar Sep 16 '22 09:09 eloipeloux

Just tried the example on the same device, tapping on Share opens the dialog but when clicking the icon Messages then nothing happens

eloipeloux avatar Sep 16 '22 09:09 eloipeloux

Well ended up restarting my simulator and the dialog opens but when clicking on Messages nothing happens ...

eloipeloux avatar Sep 16 '22 09:09 eloipeloux

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?

miquelbeltran avatar Sep 16 '22 13:09 miquelbeltran

Yessir ofc, right now :)

eloipeloux avatar Sep 16 '22 13:09 eloipeloux

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 avatar Sep 19 '22 06:09 himani2022

@himani2022 likely a bug on your side, since the example in share_plus/samples works

miquelbeltran avatar Sep 19 '22 06:09 miquelbeltran

@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?

himani2022 avatar Sep 19 '22 06:09 himani2022

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.

miquelbeltran avatar Sep 19 '22 07:09 miquelbeltran

@himani2022 I had the same problem, but after flutter clean and flutter pub get, it was working fine for me.

minhdanh avatar Sep 21 '22 16:09 minhdanh

@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.

Coronon avatar Oct 29 '22 00:10 Coronon

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

github-actions[bot] avatar Jan 28 '23 00:01 github-actions[bot]

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.

Chhinvanchhai avatar Apr 29 '24 01:04 Chhinvanchhai