At https://codelabs.developers.google.com/credential-manager-api-for-android#4 in the section "Obtain the challenge and other options to pass to getPasskey() call" Check the else block with a comment to call createPasskey() and replace with following code : is not correct, it is likely just copied from the previous step and the author forgot to edit it