GoogleCloudPlatform / android-docs-samples

Apache License 2.0
375 stars 596 forks source link

"Error:(354, 76) error: cannot find symbol variable credential" #57

Open sriranjanr opened 6 years ago

sriranjanr commented 6 years ago

I am new to google cloud api. I was able to create a private key and I set the environment variable.I put the json private key in the res/raw folder but I still get the error "Error:(354, 76) error: cannot find symbol variable credential" . Could someone please help me on this. Are there any other things I need to do with gcloud to remove this error...Please let me know.

sriranjanr commented 6 years ago

I replaced credential term with my private json key and now the project compiled and I got the apk. But when I opened that app nothing happens. I see load file and listening in the a box. Even after I pressed load file nothing is happening. My phone is connected to the internet and I waited for two minutes and still nothing...The debug version of app gets installed and the above behavior I mentioned happens with debug app but the release version app does not get installed.

sriranjanr commented 6 years ago

One more doubt..can I rename my speech key and put it in the resource folder and also set the same key for google_applicationcredentials? Because the downloaded json key name has a minus sing "-" and this is not being accepted by android.So I replaced the "-" sign with "" .

sriranjanr commented 6 years ago

Solved.I had to enable google cloud speech api for my project.This step was just written as it was understood in the quick start but a couple of steps explaining how to enable the cloud speech api should be mentioned which I got to know from another website here. https://codelabs.developers.google.com/codelabs/cloud-speech-intro/index.html?index=..%2F..%2Findex#3