I'm trying to implement Google's One Tap sign-up for my Android app in development. I am following Google's (quite outdated) official guide and so far everything has gone well, up until display of the sign-up UI where the onFailure listener returns an error when I build and run my app:
com.google.android.gms.common.api.ApiException: 10: Developer console is not set up correctly.
Here's my relevant code:
oneTapClient = Identity.getSignInClient(this);
signUpRequest = BeginSignInRequest.builder()
.setAutoSelectEnabled(true)
.setGoogleIdTokenRequestOptions(BeginSignInRequest.GoogleIdTokenRequestOptions.builder()
.setSupported(true)
.setServerClientId(getString(R.string.web_client_id))
.setFilterByAuthorizedAccounts(false)
.build())
.build();
// ActivityResultLauncher<IntentSenderReque... (irrelevant to issue)
oneTapClient.beginSignIn(signUpRequest).addOnSuccessListener(this, result -> {
IntentSenderRequest intentSenderRequest = new IntentSenderRequest.Builder(result.getPendingIntent().getIntentSender()).build();
activityResultLauncher.launch(intentSenderRequest);
}).addOnFailureListener(this, e -> {
Log.d("/////", "Failed: " + e);
}).addOnCanceledListener(this, () -> {
Log.d("/////", "Canceled.");
});
Now, as I have mentioned, I'm following the official guide and I haven't skipped a single step so the first thing I did was Google and research the error. It's at this point that I want to mention, I've reviewed every single answer to the following SO questions: 1 2 3 4 5 6 7 8 9 10 There are several, and I mean several duplicated answers that make it such a pain to find one that helps, people make a big deal about duplicated questions but I think these duplicated answers are really what needs moderation. Oh, and a lot of the answers that include code were usually deprecated and for the Legacy Google Sign In, or some other Google API and not One Tap (I still tried to see if the solutions would work regardless but to no avail).
To save everyone's time, I will address two answers that came up over and over again during my research.
- The client ID I input is the 'Web' client ID and not the Android client ID.
- SHA-1 was not asked for when making the web client ID but it was when making the android client, I did successfully create and input the correct SHA-1 as per this official guide and this (and more guides for fact-checking).
Some useful information to note: I only have one project, I do not have any variants other than the debug, and I am not using Firebase, this happens every time I run the app on my test device, the application ID is the same as the package name in the manifest, I've also tried regenerating the signed bundle.
If you have any ideas why I may be getting this error please let me know! It's been two days and I feel like I'm out of options...