【问题标题】:Add Google service credentials to Android App for connect Google Cloud将 Google 服务凭据添加到 Android 应用以连接 Google Cloud
【发布时间】:2019-07-18 12:23:46
【问题描述】:

在我的应用中,我需要使用 Google Cloud Text to Speech。我通过 grade 添加 sdk 实现“com.google.cloud:google-cloud-texttospeech:0.100.0-beta”。

之后,我不明白如何将凭据添加到我的 android 应用程序。在云控制台中,我为项目创建并添加了计费,并下载了服务帐户 json 文件。但是我可以在哪里添加 android 应用程序?如果我在不添加应用程序的情况下运行代码,则会出现异常

" 应用程序默认凭据不可用。它们是 如果在 Google Compute Engine 中运行,则可用。否则,该 必须定义环境变量 GOOGLE_APPLICATION_CREDENTIALS 指向定义凭据的文件。看 https://developers.google"

【问题讨论】:

    标签: android oauth google-cloud-platform credentials google-text-to-speech


    【解决方案1】:

    https://github.com/GoogleCloudPlatform/android-docs-samples/tree/master/speech/Speech

    在这里你可以看到如何添加凭据

    以下是我参考 Google Cloud STT 创建的 TTS 示例项目

    https://github.com/ivso0001/GoogleCloudTextToSpeech/tree/master

    【讨论】:

      猜你喜欢
      • 2021-02-12
      • 1970-01-01
      • 2013-06-15
      • 2021-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-15
      • 1970-01-01
      相关资源
      最近更新 更多