【发布时间】:2020-09-24 13:41:28
【问题描述】:
目前,AppDelegate 调用一个静态方法,为 GMSServices 提供 API 密钥。密钥正确,方法本身返回true。
GMSServices.provideAPIKey(ConfigUtils.GoogleMaps.Key)
尽管如此,当我尝试打开地图时,出现错误
Exception NSException * "Google Maps SDK for iOS must be initialized via [GMSServices provideAPIKey:...] prior to use" 0x000060000383c8d0
发生在应用程序中。
我还需要做什么才能使 GoogleMaps 正常工作吗?
我在另一个问题中发现了这个:
如果您的某些 Google 地图代码在 API 密钥初始化之前运行,则可能会发生这种情况。
但在 API 密钥初始化之前没有任何 Google 地图代码。
【问题讨论】:
-
你能展示你的 AppDelegate 代码吗?
标签: ios swift google-maps google-maps-sdk-ios