【发布时间】:2019-08-22 22:24:29
【问题描述】:
这是一个新问题,似乎与谷歌地图 API 有关 - 对我们来说是突然出现的。这似乎是不可能的,但我们的生产应用程序突然开始在我们的启动屏幕上抛出一个偶尔的错误。我们的启动屏幕主要是一个谷歌地图,即 MapView for expo。
Uncaught Error: Error using newLatLngBounds(LatLngBounds, int): Map size can't be 0. Most likely, layout has not yet occured for the map view. Either wait until layout has occurre or use newLatLngBounds(LatLngBounds, int, int, int) which allows you to specify the map's dimensions.
This only happens on our Android standalone app, through Expo it works fine.
我们遵循了适用于 Android 的文档:https://docs.expo.io/versions/v34.0.0/workflow/configuration/#android - 我们已经完成了这些步骤。据我们所知,我们已经使用不同的 API 密钥完成了两次该过程,得到了相同的结果。
我们已尝试修复建议的here,即根据尺寸设置高度和宽度、设置 flex:1 和设置 initialLocation。我们使用 onReady 来调用初始启动方法。似乎没有任何效果。
截至今天,上面的 github 链接确实有人遇到过这个问题。有什么想法可以调试吗?
【问题讨论】: