com.google.android.gms.auth.GoogleAuthException: UNREGISTERED_ON_API_CONSOLE

后端 未结 4 1975
情书的邮戳
情书的邮戳 2020-12-09 11:29

Im implementing an android app that enables users to stream to a youtube channel straight from the app. I have created an API key and a OAuth 2.0 client ID

But I ge

4条回答
  •  心在旅途
    2020-12-09 11:42

    The issue is that, when you debug, you're using a keystore created in ~/.android/debug.keystore, and not whatever signing key you think you're using.

    When you generate a key, such as to release a signed APK, you think that this SHA1 is the one required by the Google API interface. It isn't.

    If you replace the one in the ~/.android folder with your signing key, it's corrupt because it's missing the androiddebugkey. FYI, the default password for the auto-generated key is "android".

    For directions as to where your keystore is located, see https://developer.android.com/studio/publish/app-signing.html under "Expiry of the debug certificate".

    What you have to do:

    1) Delete your debug.keystore and restart your IDE. This should generate a new debug.keystore with key alias "androiddebugkey".

    2) If your IDE does not generate the new keystore, re-run your android application. It should generate it this time in ~/.android/

    3) Navigate to /path/to/jre/bin and add this path to your system environment variables. This will allow you to access keytool.

    4) Navigate to the directory of your debug keystore and run this command: keytool -list -keystore debug.keystore -alias androiddebugkey

    5) Your console will prompt you to enter the keystore password (it is "android").

    6) Get the SHA1 key from the keystore and put THAT KEY into your API interface, and you'll find it works.

提交回复
热议问题