如何设置环境变量GOOGLE

如何设置环境变量GOOGLE

本文介绍了如何设置环境变量GOOGLE_APPLICATION_CREDENTIALS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这类问题以前曾被问过,我已经经历过,但仍然面临着这个问题。我正在使用。但是,当我运行代码时,却遇到了异常

I know this type of question has been asked before and i have gone through this but still facing this issue. I was using this example . But while i run my code i got following exception

我可以从哪里设置环境v android studio中有一个版本,我是Windows用户

from where can i set environment variable in android studio, I am windows user

推荐答案

从错误

java.io.IOException:应用程序默认凭据不可用
。如果它们在Google Compute Engine中运行,则可用。
否则,必须定义环境变量GOOGLE_APPLICATION_CREDENTIALS
指向定义凭据的文件

请参阅

以获得更多信息。

See https://developers.google.com/accounts/docs/application-default-credentials for more information.

您可能需要在环境变量路径 GOOGLE_APPLICATION_CREDENTIALS = path中添加它/to/your/service_accont_key_file.json 。并应从此处。另外,如果您不知道如何设置环境变量路径,则可以检查此

You may need to add this in the environment variable path GOOGLE_APPLICATION_CREDENTIALS=path/to/your/service_accont_key_file.json. And should get the json file from here https://cloud.google.com/docs/authentication/getting-started . Also if you don't know how to set environment variable path you can check this https://www.computerhope.com/issues/ch000549.htm

这篇关于如何设置环境变量GOOGLE_APPLICATION_CREDENTIALS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 12:07