com.google.android.gms.common.api.ApiException: 16:

前端 未结 6 2027
醉梦人生
醉梦人生 2021-02-09 07:37

I try to learn how i can use google sign in in my android App, but i catch com.google.android.gms.common.api.ApiException: 16 And i can\'t find on stackoveflow

6条回答
  •  耶瑟儿~
    2021-02-09 08:01

    Maybe a bit late to the party here but after more than 4 hours debugging I realized that:

    1.- Add an Android client with your signing-certificates fingerprints under the OAuth client IDs list. This is mandatory.

    2.- Add the Web application client ID in your code in case your need to get an id token

    // ID and basic profile are included in DEFAULT_SIGN_IN
    GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                                .requestIdToken("YOUR_CLIENT_ID")
                                .requestEmail()
                                .build();
    

    Hope it helps

提交回复
热议问题