【问题标题】:Cloud Vision request failedCloud Vision 请求失败
【发布时间】:2018-03-26 09:33:54
【问题描述】:

我创建了一个 android 应用程序,用户在其中上传图像,我需要在上传之前检查它们是否有不适当的内容。我创建了一个 Cloud Vision acc,在那里创建了一个项目,仅通过提供包名称和 SHA1 指纹将其限制为 Android 应用程序,然后我获得了 API 密钥,也启用了计费和 Cloud Vision API。然后在我的android项目中我设置了那个API。现在在测试时出现以下错误:

Request failed: {
  "code": 403,
  "errors": [
    {
      "domain": "global",
      "message": "Requests from this Android client application <empty> are blocked.",
      "reason": "forbidden"
    }
  ],
  "message": "Requests from this Android client application <empty> are blocked.",
  "status": "PERMISSION_DENIED"
}

【问题讨论】:

  • Requests ... are blocked.中有什么不明白的地方?
  • 没有什么明确的定义可以理解

标签: android google-cloud-vision


【解决方案1】:

为什么是你的应用程序名称?如果您对 API 密钥设置了特定限制,但您的应用程序没有被正确识别,那么它被拒绝是有道理的。

请确保您首先拥有properly enabled the API,并确保为您的代码创建了正确的API key / service account

事实上,我认为这个tutorial 可能更简单,因为它是专为 Android 设计的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-18
    • 2019-03-13
    • 1970-01-01
    • 1970-01-01
    • 2019-07-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多