Google Api and android Oauth INVALID_AUDIENCE error

后端 未结 5 1029
梦毁少年i
梦毁少年i 2020-12-31 05:09

I am getting a GoogleAuthException: Unknown error, while doing a GoogleAuthUtil.getToken.

Just before the exception I see



        
5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 05:33

    In the interest of documenting my issue,

    I had the same INVALID_AUDIENCE error come back from a Google sign-in through an AWS Mobile Hub generated sample app. A few things to check,

    Like Tim Bray notes aboves, make your client id a valid web client id (not Android). But also have an android client id that has both the proper SHA-1 Fingerprint (found in debug.keystore which Android Studio uses to sign debug builds when you click Run) and package name.

    NOTE: The package name listed in the AndroidManifest.xml is not always the actual package name. To find the definitive package name, go to the build.gradle file and see the applicationId field. Be sure to input the right package name in the Developers Console when you configure the Android Client Id.

提交回复
热议问题