0

enter image description hereenter image description hereI am building an application that uses firebase and share the content of the application The app was working fine and when I added the firebase packages I got errors:

MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher)

MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/share)

MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/google_mobile_ads)

I have tried more than one method (flutter clean) many times (flutter pub get) many times (flutter run) (reinstall app) many times I searched for solutions but it didn't work

class Home extends StatefulWidget {
static String id = 'HomeScreen';
const Home({Key? key}) : super(key: key);

@override
_HomeScreenState createState() => _HomeScreenState();
 }

class _HomeScreenState extends State<Home> {

Future<InitializationStatus> _initGoogleMobileAds() {
return MobileAds.instance.initialize();
}


 late BannerAd _bannerAd;

 bool _isBannerAdReady = false;

  @override
  void initState() {
 _bannerAd = BannerAd(
  adUnitId: AdHelper.bannerAdUnitId,
  request: AdRequest(),
  size: AdSize.banner,
  listener: BannerAdListener(
    onAdLoaded: (_) {
    setState(() {
      _isBannerAdReady = true;
    });
    },
    onAdFailedToLoad: (ad, err) {
     print('Failed to load a banner ad: ${err.message}');
     _isBannerAdReady = false;
      ad.dispose();
    },
  ),
 );

 _bannerAd.load();
 enter image description here}


 @override
 void dispose() {
  _bannerAd.dispose();
  super.dispose();
 }}

I added ads in same class that has _launchUrl()

    _launchURL() async {
    const url = 'url';
    if (await canLaunch(url)) {
    await launch(url);
    } else {
  throw 'Could not launch $url';
   }
  }

and _share() method also

         onTap: () {
           Share.share(appUrl);
              },
11
  • where do you use canLaunch()? Commented Jul 31, 2021 at 7:26
  • Please share the code that causes these exceptions. Commented Jul 31, 2021 at 7:34
  • Check out How to Ask to improve this question Commented Jul 31, 2021 at 7:58
  • hello, thnks for help I added ads in the same class that has a method _launchUrl() Commented Jul 31, 2021 at 11:31
  • @PeterKoltai @ Alex.F Commented Jul 31, 2021 at 11:34

1 Answer 1

2

I got the answer I was using the flutter_facebook_auth package: when read doc link description here

When you install this plugin you need to configure the plugin on Android before run the project again . If you don't do it you will have a No implementation found error because the facebook SDK on Android throws an Exception when the configuration is not defined yet and this locks the other plugins in your project. If you don't need the plugin yet please remove or comment it.

Sign up to request clarification or add additional context in comments.

1 Comment

Can you explain how to fix this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.