Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google maps 在颤振中运行google heat map时出错_Google Maps_Flutter_Dart_Heatmap - Fatal编程技术网

Google maps 在颤振中运行google heat map时出错

Google maps 在颤振中运行google heat map时出错,google-maps,flutter,dart,heatmap,Google Maps,Flutter,Dart,Heatmap,我是一名新手,我正在尝试使用这个插件在谷歌地图google\u地图\u flatter\u热图0.1.1+2中创建热图 但每次我运行代码时,都会出现此错误。我已经将APK密钥添加到清单文件中,并尝试了flatterclean,但仍然是一样的 E:\~MobileDev\flutter project\myproject\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:32: error: co

我是一名新手,我正在尝试使用这个插件在谷歌地图
google\u地图\u flatter\u热图0.1.1+2中创建热图
但每次我运行代码时,都会出现此错误。我已经将APK密钥添加到清单文件中,并尝试了
flatterclean
,但仍然是一样的

E:\~MobileDev\flutter project\myproject\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:32: error: constructor GoogleMapsPlugin in class GoogleMapsPlugin cannot be applied to given types;
    flutterEngine.getPlugins().add(new io.flutter.plugins.googlemaps.GoogleMapsPlugin());
                                   ^
  required: Registrar
  found: no arguments
  reason: actual and formal argument lists differ in length
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
编辑:


我尝试删除另一个插件,它是
google\u-maps\u-flatter:^0.5.30
。现在它开始工作了。这是否意味着这两个插件之间存在冲突?还有什么我可以同时使用它们吗?

是的,你是对的,这两个软件包之间存在冲突,因为名称
GoogleMaps
存在于两个软件包中:
GoogleMaps\u flatter\u heatmap
GoogleMaps\u flatter

如果要同时使用这两个包,则需要使用“as prefix”导入这些包以区分它们。例如:

import "package:google_maps_flutter/google_maps_flutter.dart" as gmaps;
import "package:google_maps_flutter_heatmap/google_maps_flutter_heatmap.dart" as heatmap;
然后,您可以通过在使用的前缀之一前加前缀来声明
GoogleMap
。比如说,您想在
google\u maps\u flatter
包中使用
GoogleMap
。然后会是这样的:

gmaps.GoogleMap(
  initialCameraPosition: _initialLocation,
),