当我点击注册账号的时候,报错了

来源:6-7 登录功能交互体验优化

浅忆无痕

2024-09-28

我使用的版本:url_launcher: ^6.1.9
我的代码: Future _jumpRegistration() async {
// 跳转到接口后台注册账号
Uri url = Uri.parse(
https://api.geekailab.com/uapi/swagger-ui.html#/Account/registrationUsingPOST’);
if (!await launchUrl(url, mode: LaunchMode.externalApplication)) {
throw Exception(‘Could not launch $url’);
}
}
控制台抛出的错误:Restarted application in 260ms.
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method launch on channel plugins.flutter.io/url_launcher)
#0 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:308
错误信息对应的代码指向:
图片描述

写回答

1回答

CrazyCodeBoy

2024-09-28

这个问题在于url_launcher这个插件包含安卓和iOS代码,在课程中有讲到对于这样的插件的,集成进去之后需要关闭app,停止项目运行,然后再重新运行项目生成新的安装包就可以了。
1
0

慕课甄选-Flutter零基础极速入门到进阶实战

全新Flutter从入门到进阶,实战仿携程网App

732 学习 · 340 问题

查看课程