Problem setting the GOOGLE_APPLICATION_CREDENTIALS for my app
Hello! My problem is that when I try to set the GOOGLE_APPLICATION_CREDENTIALS environment variable, if I print the path it is correct. But when I try to create the instance of the Database and exception unhandled appears with the next message:
Error readind credential file from location X. Could not find a part of the path X. Please check the value of the environtment variable. But the value is correct and is set to the path of the private key of google project.
I set it on the app.xaml.cs on my base xamarin form project with Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", "C:/Users/myuser/Downloads/projectname-319700-ae570902a804.json");
If I add it on the project properties debug, it does not recognize it. Also I tried to set it on my CMD and restarting visual, but it neither recognize it. If I use this last option the exception is: 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.
I'm trying to follow the next guide : https://cloud.google.com/docs/authentication/getting-started
I'm doing this to connect my app to a firebase firestore database