Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
406 views
in Technique[技术] by (71.8m points)

MissingPluginException while using plugin for flutter

I am trying to use the plugin

_launchURL(url) async {
  await launch("www.google.com");
}

I have put "www.google.com" just for debugging purposes.

The error I get is MissingPluginException :

E/flutter ( 8299): MissingPluginException(No implementation found for method launch on channel plugins.flutter.io/url_launcher)
E/flutter ( 8299): #0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
E/flutter ( 8299): <asynchronous suspension>
E/flutter ( 8299): #1      launch (package:url_launcher/url_launcher.dart:47:19)
E/flutter ( 8299): #2      _launchURL (file:///Users/matejsimunic/Work/dart/suhail/lib/main.dart:834:9)
E/flutter ( 8299): <asynchronous suspension>
E/flutter ( 8299): #3      _TripDetailBodyState.build.<anonymous closure> (file:///Users/matejsimunic/Work/dart/suhail/lib/main.dart:818:19)
E/flutter ( 8299): #4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:494:14)
E/flutter ( 8299): #5      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:549:30)
E/flutter ( 8299): #6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
E/flutter ( 8299): #7      TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161:9)
E/flutter ( 8299): #8      TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:94:7)
E/flutter ( 8299): #9      PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9)
E/flutter ( 8299): #10     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
E/flutter ( 8299): #11     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
E/flutter ( 8299): #12     _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:19)
E/flutter ( 8299): #13     _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121:22)
E/flutter ( 8299): #14     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101:7)
E/flutter ( 8299): #15     _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64:7)
E/flutter ( 8299): #16     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48:7)
E/flutter ( 8299): #17     _invoke1 (dart:ui/hooks.dart:134:13)
E/flutter ( 8299): #18     _dispatchPointerDataPacket (dart:ui/hooks.dart:91:5)

restarting the app from ide doesn't work.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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. Check this issue for more.

Close the app and execute flutter run command.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...