android - 来自 Android Play Places 的 PLACES_API_INVALID_APP 错误

标签 android google-places-api

我正在尝试来自 https://github.com/googlesamples/android-play-places 的 Google Place 自动完成示例.

我已将正确的 API key 放在正确的位置。我知道这一点,因为当我输入一个随机字符串无效的 API key 时,我会得到一个不同的错误。

因此,在输入正确的 API key 后,我会在真实设备和模拟器中运行该应用程序。两种设备都给我这个错误:

状态{statusCode=PLACES_API_INVALID_APP, resolution=null}

导致此错误的原因以及如何解决?

最佳答案

这是因为您放置在 Developers Console 凭据部分的包与您正在构建的项目不同。

  1. 打开https://console.developers.google.com
  2. 转到左侧的 APIs & auth 菜单,然后转到 Credentials
  3. 您可以添加新的 Android API 并放置您正在构建的包,或者编辑任何现有的并添加另一个包名称和指纹 (SHA1)。

关于android - 来自 Android Play Places 的 PLACES_API_INVALID_APP 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33115337/

相关文章:

android - 如何在android的设置屏幕中显示已安装的日历列表

android - Google Place API - 自动完成 - 如何获取邮政编码?

android - Google Places API 配额超出

node.js - 在nodejs中传递下一页 token 后无法访问google place api

Android 对端未通过身份验证

android - <uses-permission> 元素必须是 <manifest> 根元素的直接子元素

java - 尝试导航到上一个 Activity 时 Intent 崩溃

java - 如何在Android模拟器上测试sensormanager?

javascript - 仅在选择输入时获取谷歌位置自动完成值

javascript - 谷歌API地点搜索不工作 Node js