• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Cloud to Speech API -- "Application Default Credentials are not available" ?

T

Tembler3909

Guest
I'm trying to integrate Cloud Speech to Text API into my Android mobile app (minSdkVersion 19, androidx, java). After following the instructions here, compiling & running my app, the app throws a catch from within the "sampleRecognize" method:

java.io.IOException: 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.

For the record, I'm composing my app under Windows 7 and Android Studio. The Windows system variables and user variables both have the following:

GOOGLE_APPLICATION_CREDENTIALS = D:\MyCred.json

The code is nothing more than what is listed here. Am i supposed to add extra code to make use of the JSON file which Google neglected to mention?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones