【发布时间】:2013-11-18 18:40:31
【问题描述】:
我有一个简单的 iOS 应用程序,我在其中集成了 Google 地图。但是,当显示我的地图视图时,我提供的 API 密钥会导致以下几条错误消息:
ClientParametersRequest failed, 3 attempts remaining (0 vs 5). Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed. (com.google.HTTPStatus error 400.)" UserInfo=0x1818bf40 {data=<CFData 0x18137410 [0x302aec8]>{length = 145, capacity = 256, bytes = ...}}
这是我已经尝试过但无济于事的:
- 调用
[GMSServices provideAPIKey:]作为didFinishLaunchingWithOptions中的第一行代码 - 仔细检查我的 API 密钥是否正确并且是 iOS API 密钥(我将它直接从 Google Cloud Console 复制/粘贴到我的应用中)
- 提供带有
{}和不带有{}的API 密钥 - 通过输出
[[Bundle mainBundle] bundleIdentifier]来确认我的包名称 - 完全忽略捆绑标识符限制
- 重新生成 API 密钥
我不确定还可以尝试什么。我的包名称采用这种格式:net.company.MyApp,并且我已将它完全输入到 Google Cloud Console 中(我知道包 ID 区分大小写)。
可能是因为 Google 不支持某种类型的捆绑标识符(例如,以大写字母或以 net. 开头)?
【问题讨论】: