Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: cannot find symbol method silentSignIn()

i follow step on https://developers.google.com/identity/sign-in/android/backend-auth

GoogleSignIn.silentSignIn()
        .addOnCompleteListener(this, new OnCompleteListener<GoogleSignInAccount>() {
            @Override
            public void onComplete(@NonNull Task<GoogleSignInAccount> task) {
                handleSignInResult(task);
            }
        });

but i get error: cannot find symbol method silentSignIn() Any help appreciated.

like image 896
ndemoh Avatar asked May 24 '26 09:05

ndemoh


1 Answers

I believe it was written on the docs this way by mistake.

1- The method silentSignIn is not static.

2- The silentSignIn is a method of the GoogleSignInClient class.

So the right way to invoke it, is:

GoogleSignInClient googleSignInClient = GoogleSignIn.getClient (activity, gso);

googleSignInClient.silentSignIn ()
    .addOnCompleteListener (activity, new OnCompleteListener<GoogleSignInAccount> () {

        @Override
        public void onComplete (@NonNull Task<GoogleSignInAccount> task) {
            handleSignInResult (task);
        }
    });

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!