未将提供的API密钥配置为可在Google map Road Api中的此Android应用中使用 [英] The supplied API key is not configured for use from this Android app in Google map Road Api

查看:92
本文介绍了未将提供的API密钥配置为可在Google map Road Api中的此Android应用中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我已完成的步骤:

Below are the steps I have done:

  1. 选择Google Maps Road API ,并通过传递 SHA key Package name 将密钥限制为android.

  1. Select Google Maps Road API and restrict the key to android by passing SHA key and Package name.

我还启用了另一个API,即 Google Maps Android API ,可以很好地使用该代码.

I have also enable the another API i.e Google Maps Android API which is working fine with the code.

我删除了密钥限制,但得到了相同的结果.

I have removed the restriction of key but getting same result.

在开发者控制台上,每个Google Map Road API请求都进入错误列.

On Developer console, every google map road API request goes into the error column.

请帮我解决这个问题,因为我无法弄清楚另一个API密钥有什么问题,但可以正常工作,但是在道路API中却出错.

Please, help me solve this issue as I'm not able to figure out what's wrong with this another API key's are working fine but getting error in road API.

{
  "error": {
    "code": 403,
    "message": "The supplied API key is not configured for use from this Android app.",
    "status": "PERMISSION_DENIED",
    "details": [
    {
      "@type": "type.googleapis.com/google.rpc.Help",
      "links": [
      {
        "description": "Google developer console API key",
        "url": "https://console.developers.google.com/project/41764599888/apiui/credential"
      }
      ]
    }
    ]
  }
}

推荐答案

google map road api 上花了几个小时后,

我来到了解决方案:

这是在Google Map Road API上的提示:

This is tip which is over google map road api:

在开发和测试期间,您可以注册一个项目进行测试 在Google API控制台中使用,并使用通用的不受限制的API 钥匙.当您准备将您的应用程序或网站投入生产时, 注册一个单独的项目进行生产,创建一个服务器限制的 API密钥,然后将该密钥添加到您的应用程序中.

During development and testing, you can register a project for testing purposes in the Google API Console and use a generic, unrestricted API key. When you are ready to move your app or website into production, register a separate project for production, create a server-restricted API key, and add the key to your application.

您只需要像以前那样以错误的方式从密钥中删除限制即可.

You just need to remove restriction from the key as i was doing this before in wrong way.

这篇关于未将提供的API密钥配置为可在Google map Road Api中的此Android应用中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆