flutter - MissingPluginException(MissingPluginException(在通道 lyokone/location 上找不到方法 getLocation 的实现))
问题描述
我正在创建我的第一个颤振应用程序,所以希望我没有问任何愚蠢的问题。我正在使用颤振的位置插件,我不断收到以下错误:
MissingPluginException (MissingPluginException(No implementation found for method getLocation on channel lyokone/location))
这是我的代码:
void _trackLocation() async {
int time = 0;
Location location = new Location();
LocationData start = await location.getLocation();
double lat1 = start.latitude;
double lon1 = start.longitude;
await Future.delayed(Duration(seconds: 5));
LocationData end = await location.getLocation();
double lat2 = end.latitude;
double lon2 = end.longitude;
print(lat1);
setState(() {
//distance = _getDistance(lat1, lon1, lat2, lon2);
distance += 1;
});
我知道已经有人问过这个问题,但是没有一个解决方案对我有用。我已经尝试过清理并重建应用程序,但我一直收到同样的错误。我不知道该怎么做,所以任何事情都会不胜感激。谢谢!
解决方案
推荐阅读
- javascript - 控制鼠标滚轮滚动速度
- flutter - 颤振:D / ConnectivityManager(32004):requestNetwork;CallingUid : 10294, CallingPid : 32004
- wolfram-mathematica - 如何在mathematica中以不等间隔评估函数?
- android - 如何在用xml编写的标准底页对话框中使用jetpack compose的lazyColumn?
- html - 删除浏览器自动填充功能
- python - 句子相似性模型没有捕捉到相反的句子
- javascript - 动画 JS,使用我在函数 scalebigger 中获得的值来更改 clickedI.name 不起作用
- sql - 如果 SQL Schema 不存在则跳过它
- tensorflow - 微调后如何使用语言模型进行预测?
- java - 用户模块的 Java 静态链接,无需构建 JRE 运行时映像