0

Upon publishing my application, I tried the google sign in button and an error code popped up in a toast message "10:" I'm not sure exactly what that is. I have the SHA 1 added in to the firebase database as well.

 // Configure Google Sign In
    GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestIdToken(getString(R.string.default_web_client_id))
            .requestEmail()
            .build();
    mGoogleSignInClient = GoogleSignIn.getClient(this,gso);

    mAuth = FirebaseAuth.getInstance();

    signup1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    startActivity(new Intent(MainActivity.this, RegisterActivity.class));
                            }

        });


 //google login
    signInButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent signInIntent = mGoogleSignInClient.getSignInIntent();
            startActivityForResult(signInIntent, RC_SIGN_IN);


        }

    });
Jakir Hossain
  • 3,830
  • 1
  • 15
  • 29
Carlos Craig
  • 149
  • 1
  • 14

1 Answers1

2

The solution is pretty simple assuming this could be your problem,

Your SHA key does not match with the signed APK published in your Play Store.

Go to Play Console->Release Management->App Signing

Under App signing certificate you will find your key. Add that to your Firebase.

NOTE: This is an instant process and your signin will start working immediately.

sanjeev
  • 1,664
  • 19
  • 35
  • I have not placed my app in the google play store yet. I just had the apk file first to test how it would be before adding to play store – Carlos Craig Nov 22 '19 at 12:01
  • now I figured how to get to the app signing, and when I ran the application by installing from my android studio, it worked, however, when I generated and apk, ( not app bundle) to distribute and install from my google drive, the error occurred again. Is it because I am not generating from app bundle? – Carlos Craig Nov 22 '19 at 12:27
  • got it to work now using your help, thanks again @sanjeev – Carlos Craig Nov 22 '19 at 16:09