gpt4 book ai didi

flutter - 使用 flutter 插件时出现 MissingPluginException

转载 作者:IT老高 更新时间:2023-10-28 12:33:45 25 4
gpt4 key购买 nike

我正在尝试使用插件

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

我放“www.google.com”只是为了调试。

我得到的错误是 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)

从 ide 重启应用不起作用。

最佳答案

如果您正在使用热重启或热重载,它不会成功。由于 Flutter 必须将插件依赖项注入(inject)应用程序的特定平台部分,因此热重启/热重载不足以触发注入(inject)。检查这个issue了解更多。

关闭应用并执行flutter run命令。

关于flutter - 使用 flutter 插件时出现 MissingPluginException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50459272/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com