How do I do “Authenticating Your Client with Google”?

这一生的挚爱 提交于 2020-01-04 03:51:14

问题


How do I Authenticating Your Client correctly with google? I'm following this tutorial https://developers.google.com/android/guides/client-auth

I copy this text into my command prompt -

keytool -exportcert -list -v \ -alias androiddebugkey -keystore %USERPROFILE%.android\debug.keystore

I get this message back "-alias is not recognized as an internal or external command, operable program or batch file."

What am doing wrong?


回答1:


The copied command shouldn't contain the backslash after -v and it must be placed in one single line, like this:

keytool -exportcert -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore

Besides you have to change the %USERPROFILE% location in the command to the path where the .android directory located. (Maybe it is here: C:\User\YourUserName\ , but you have to check it if it's there)




回答2:


set your cmd path to jdk then run this cmd
WINDOWS
keytool -list -v -keystore %USERPROFILE%/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

MAC/LINUX
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android




回答3:


I think the end goal is to generate the SHA1 key.

Best Alternative is to follow following steps:

  1. In Android Studio, click on gradle on the right side panel.

  2. And then navigate to app > Tasks > android > sogningReport.

  3. Double clicking it will generate the SHA1 key.


来源:https://stackoverflow.com/questions/34187555/how-do-i-do-authenticating-your-client-with-google

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!