androidoauth-2.0android-keystore

Android - Google signin issue with Oauth2


I encounter an error when implementing google signin on my application.

During the test of my application, after selecting a google account I get this error:

W/SignInActivity: signInResult:failed code=10

After some research I tried to add the Oauth2 client id.

I generated it via the google console by indicating the name of the package present in the manifest. And I retrieved the SHA1 code using "signinReport" from android studion. (I got the debug key because I use the build debug variant).

Then I put it there:

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
    .requestEmail()
    .requestIdToken("MY_TOKEN")
    .build();

I also read several topics about the google-services.json file. But I can't find it on google console. Does it still exist?

Thank you for your help.


Solution

  • I think this 2 blogs solved your problem, pls read this

    Goole auth

    Google Login

    This one is help for you