Flutter share_plus is not working and getting error

719

If you are using hot restart or hot reload, it won't do the trick. Since Flutter has to inject plugin dependencies into the platform-specific parts of your app, hot restart/hot reload is not enough to trigger the injection.

Close the app and execute command.

flutter clean

flutter run

Share:
719
Superjay
Author by

Superjay

Student studying Flutter and UIUX designing.

Updated on January 02, 2023

Comments

  • Superjay
    Superjay over 1 year

    I want to share text / url in my app and I'm using share_plus plugin for this.

            IconButton(
                icon: const Icon(Icons.share),
                onPressed: (){
                  Share.share("Testing Share function");
                }
            ),
    

    And I'm getting error:

    E/flutter (21225): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method share on channel dev.fluttercommunity.plus/share)
    E/flutter (21225): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)
    E/flutter (21225): <asynchronous suspension>
    E/flutter (21225): 
    

    How to fix this?

  • Superjay
    Superjay over 2 years
    It was very simple! Thank you very much.
  • Anmol Mishra
    Anmol Mishra over 2 years
    Welcome........