【问题标题】:Google Places Api Key Not authorizedGoogle Places Api Key 未授权
【发布时间】:2015-07-02 19:06:12
【问题描述】:

我在 android 应用程序中使用谷歌地方,我收到此错误

{
   "error_message" : "This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console",
   "html_attributions" : [],
   "results" : [],
   "status" : "REQUEST_DENIED"
}

我尝试过使用 Android 密钥、浏览器密钥和服务器密钥,但这不起作用请帮助我,我不知道密钥有什么问题...!! 请帮我 我使用的网址是:

https://maps.googleapis.com/maps/api/place/search/json?radius=50&sensor=true&key=<my key>&location=22,75

【问题讨论】:

  • @DanielNugent 仍然遇到同样的错误
  • 您是否在开发者控制台中启用了Google Places API Web Service
  • 你的链接现在对我有用,所以我想你的问题已经解决了。以后再也不要发布您的 API 密钥。
  • 是的,它现在也对我有用,thanx @DanielNugent 你帮了我很多,我欠你的,

标签: android api google-api google-places


【解决方案1】:

确保您为有效密钥启用有效 API。

注意:- 为浏览器 api 服务器启用位置 api - 浏览器密钥。 放置 api for android key - android key

【讨论】:

    【解决方案2】:

    点击以下链接注册谷歌地图密钥

    https://developers.google.com/maps/documentation/android/start

    并确保您已从 api 和 auth 启用 api,

    同时提供 sha1 密钥和您的应用程序包名称,提供有效数据。

    希望对你有帮助

    【讨论】:

    • 请注意,本题的API需要服务器密钥,不需要指定sha1值或包名。
    • @user3508256 是的,我自己也将它与浏览器密钥一起使用,并且运行良好!虽然文档说只能与服务器密钥一起使用。
    【解决方案3】:

    确保您已启用“Google Places API 网络服务”(在您的 Google Api 控制台上,https://console.developers.google.com)。您必须使用 服务器密钥(不是 Android 密钥)

    【讨论】:

      【解决方案4】:

      "status" : "REQUEST_DENIED" - 表示有关启用 Google API 权限的问题。 请确保您没有忘记启用 API:

      Google 地图 Android API
      Google 地图地理编码 API
      谷歌地图地理定位 API
      适用于 Android 的 Google Places API
      Google Places API 网络服务

      我也面临同样的问题,但是在浏览开发者网站后我发现;它也需要为 Web 服务启用 Places API 并为我工作。

      希望这可能会有所帮助!

      【讨论】:

        【解决方案5】:

        "status" : "REQUEST_DENIED" 表示有关启用 Google API 权限的问题。请确保您没有忘记启用 API:

        • Google 地图 Android API
        • Google 地图地理编码 API
        • Google 地图地理位置 API
        • 适用于 Android 的 Google Places API
        • Google Places API 网络服务

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2020-05-05
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多