10

When I copied the following code from this developer.android.com tutorial about adding biometric authentication in your android app:

BiometricPrompt.PromptInfo promptInfo =
            new BiometricPrompt.PromptInfo.Builder()
            .setTitle("Biometric login for my app")
            .setSubtitle("Log in using your biometric credential")
            .setNegativeButtonText("Cancel")
            .build();

PromptInfo is not recognized.

I have followed all the steps prior to this in the tutorial.

Vansh Arora
  • 266
  • 2
  • 12

1 Answers1

29

You need to add this dependency:

implementation 'androidx.biometric:biometric:1.0.0-rc01'

And make sure you use this import:

import androidx.biometric.BiometricPrompt;

and not

import android.hardware.biometrics.BiometricPrompt;
Traendy
  • 916
  • 7
  • 12