Closed Ranjith1992 closed 7 years ago
Hello Ranjith1992
Rename the file to client_secret_NNNN.json and copy to the project root directory. You don't have to rename the file but it makes it easier but it must be put in the project root directory.
try:
sudo pip install google-auth-oauthlib[tool] sudo pip install click
google-oauthlib-tool --client-secrets client_secret_NNNN.json --credentials app/src/main/res/raw/credentials.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save
A web page pops up and you choose your google account which then creates and saves the credentials.json in the correct directory.
Build the APK - the build will fail if the credentials.json is not in the res/raw folder.
From the command line: adb connect Android.local ./gradlew assembleDebug adb install -r app/build/ouputs/apk/app-debug.apk (-r to replace a previous version) adb reboot
best regards
Do the google-oauthlib-tool can run on Windows?if it can,i have get promble with the same,the last error is ....client_secret=self.client_config['client_secret'], KeyError: 'client_secret'
I solved this error. While creating client_secret_NNNN.json file i choose "other" instead of "android". Then issue was resolved.If you have same issue,Please try this fix.
yet!i try it this what you said,but the new question is happend,when i run the application upload the audioRecord to Google Assistant,but the downLoad AudioTrack is Sound noisy!I do not why!
Which device your running the application ? what about the audio h/w profile of the device ? Audio is working fine in my HTC nexus 9 tab with high speed wifi.
May be issue due audio h/w profile or low speed internet.
Ok!my running device is Raspberry pie 3!I creating client_secret_NNN.json file i choose "android".And download client json file,and run command:
E:\CaiPro\github\AndroidThings\googleSample\sample-googleassistant>google-oauthlib-tool --client-secrets
client_secret.json --credentials app/src/main/res/raw/credentials.json --scope https://www.googleapis.c
om/auth/assistant-sdk-prototype --save
Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_ty
pe=code&client_id=597978834045-pq66vegggovl00osjtf9ho56koiv1k11.apps.googleusercontent.com&redirect_uri=ht
tp%3A%2F%2Flocalhost%3A8080%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fassistant-sdk-prototype&sta
te=wAOe4XJ8d3J2ahcV3wlJqXYi8D14Wi&access_type=offline
Traceback (most recent call last):
File "f:\developertools\python\lib\runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "f:\developertools\python\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "F:\developerTools\python\Scripts\google-oauthlib-tool.exe__main.py", line 9, in
client_secret=self.client_config['client_secret1'],
KeyError: 'client_secret1'
My developer envirment is windows 7 OS!Not linux
Dear Ranjith1992, you are right,I should choose the "other" option,now my devices can run on By Google Assistant,thank you for your answer!,the question before is my mircophone was broken!Oh my gad
Happy to know it's working :)
while creating client_secret_NNN.json If you choose "android" it will not work. Please choose "other" and it will work.
If I insist on choose "Android",how can resolve this error? thanks!
I tried to create credentials.json from my ubuntu system. But iam getting the following error. Step i followed:
google-oauthlib-tool --client-secrets client_secret_181189387533-2oksu7u1qas4n65lgermqejhb2roj68m.apps.googleusercontent.com.json --credentials /home/ranjith/GoogleAssistant/add/credentials.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save
Error Occured :
Traceback (most recent call last): File "/home/ranjith/env/bin/google-oauthlib-tool", line 11, in