0

i have set environment variable for google credentials but i don't know what is the next step. Please help me to solve this error

The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
at com.google.auth.oauth2.DefaultCredentialsProvider.getDefaultCredentials(DefaultCredentialsProvider.java:119)
at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:127)
at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:100)
at com.google.api.gax.core.GoogleCredentialsProvider.getCredentials(GoogleCredentialsProvider.java:53)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:134)
at com.google.cloud.vision.v1.stub.GrpcImageAnnotatorStub.create(GrpcImageAnnotatorStub.java:61)
at com.google.cloud.vision.v1.stub.ImageAnnotatorStubSettings.createStub(ImageAnnotatorStubSettings.java:93)
at com.google.cloud.vision.v1.ImageAnnotatorClient.<init>(ImageAnnotatorClient.java:131)
at com.google.cloud.vision.v1.ImageAnnotatorClient.create(ImageAnnotatorClient.java:112)
at com.google.cloud.vision.v1.ImageAnnotatorClient.create(ImageAnnotatorClient.java:103)
at com.example.vision.QuickstartSample.main(QuickstartSample.java:42)

Environment variable

Umang Soni
  • 137
  • 1
  • 2
  • 14
  • Refer this document for the [next step](https://cloud.google.com/docs/authentication/getting-started#verifying_authentication). From your post, I understand you are trying to setup authentication for the server and trying to provide credentials to your app. You can follow steps described in [this document](https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application). Alternatively, you can create a service account and provide credentials manually as explained in the next paragraphs on the same page. Let me know this helps? – D Saini Apr 27 '18 at 19:46
  • Thanks for this suggestion..! - @DSaini I have tried this option for set the environment variable. set GOOGLE_APPLICATION_CREDENTIALS=PathToYourJsonFile – Umang Soni Apr 28 '18 at 12:27
  • Can you confirm if that resolved your query? If yes, I will update the answer. – D Saini May 02 '18 at 16:46

0 Answers0