I'm trying to work with Google photos API. When trying to access the cloud, the following exception thrown:
Exception in thread "main" com.google.api.gax.rpc.UnavailableException: io.grpc.StatusRuntimeException: UNAVAILABLE: Credentials failed to obtain metadata
and further error is:
Caused by: com.google.api.client.http.HttpResponseException: 401 Unauthorized
I don't really understand why authorization doesn't work with Google photos API, as I created project in API console and enabled Google photos API using google 'quick start' page, successfully passed all authorization process with a cloud (tokens file created). The PhotosLibraryClient successfully acquired, but if I try to do some action on cloud (to list albums, for example) the exception above thrown. The thing is interesting, as I have in my project module that works with Gmail API and it does succeed doing actions on Gmail cloud (like deleting and sending mails). Please advise