【发布时间】:2020-02-28 20:54:03
【问题描述】:
在启动屏幕之后,我的应用程序的第一页上有一个谷歌地图。 当我第一次运行该应用程序和一个非常新的版本时,它在 IOS 上崩溃并出现以下错误:PlatformException(create_failed, can't create a view on a headless engine, null) 。
这是我的谷歌地图代码,只有第一次安装应用时才会在 IOS 中发生崩溃。
GoogleMap(
myLocationEnabled: false,
myLocationButtonEnabled: false,
zoomGesturesEnabled: true,
scrollGesturesEnabled: true,
rotateGesturesEnabled: false,
tiltGesturesEnabled: false,
onMapCreated: _onMapCreated,
initialCameraPosition: CameraPosition(
target: _location,
zoom: 12,
/* tilt: 50.0,
bearing: 45.0,*/
),
mapType: _currentMapType,
markers: Set<Marker>.of(markers.values),
onCameraMove: _onCameraMove,
onCameraIdle: _onCameraIdle,
)
我正在 GitHub 上跟进这个问题:https://github.com/flutter/flutter/issues/36310 但它没有适当的解决方案。 谁能帮我解决这个问题?
【问题讨论】:
-
如果您仍然遇到此问题,您能否分享更多代码,例如您的脚手架以及支持功能,例如
_onMapCreated。
标签: google-maps flutter flutter-layout